this is a very broad subject / specification. but... to put things in perspective, something along the lines of: Name: <input type="text" id="name" name="name" /> <button id="me" data-name="dimitar"><< use your name</button> ... <script> document.getElementById("me").onclick = function() { document.getElementById("name").setAttribute("value", this.getAttribute("data-name")); } </script> PHP: clicking the button will insert the value of data-name property into the input form field. p.s. i've not really run this to test it - it ought to work. you can apply a similar principle that references your form input fields and puts data into them...