Filling the form area
<p>I am having a PHP (HTML) page with 2 buttons.One button is used to get information(button 1) and the other button is used to submit the information(button 2).Both these buttons are linked to one form field called id.</p>

<p>when user enters the id and presses the get button(button 1) all the information about that id(name,age...) will be fetched from the database and will be displayed on the <strong>same</strong> html page(i used jquery for this).</p>

<p>button 2(submit)
When the user wants to submit the information the user enters the id and details in the other form boxes(name,age.. form boxes) and then clicks submit button, all the information entered about the id will be submitted to database.</p>

<p>All the above stuff works fine for me and here is the snippet of the code i used.</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
&lt;script type="text/javascript" src="jquery.js"&gt;&lt;/script&gt; 
&lt;script type="text/javascript"&gt;
//get information from DB using script_1.php
$(document).ready(function(){
$("#button1").click(function(){
    $.post('script_1.php', { name: $('input[name$="name"]', '#myForm').val() },
        function(output) {
            $('#age').html(output).show();
        });
});
//submit info to DB using script_2.php
$("#button2").click(function(){
    $('form#myForm').attr({action: "script_2.php"});
    $('form#myForm').submit();
});
});

&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;form id="myForm" method="post"&gt;
id: &lt;input type="text" name="name"/&gt;
&lt;input type="button" id="button1" value ="Get"/&gt;
&lt;input type="button" id="button2" value="Submit to script 2" /&gt;
name:&lt;input type="text" name="title"/&gt;
age:&lt;input type="text" name="title"/&gt;
&lt;/form&gt;
&lt;div id="age"&gt;&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>Here is my <strong>QUESTION</strong> or <strong>PROBLEM</strong></p>

<p><strong>Only related to get button(button 1)</strong></p>

<p>The information i am getting from the database using get button(button 1) is displayed at the bottom of the same html page, Instead what i want to do is the information fetched should be displayed in the respective form box i.e., when the user submits the id the information about the id like name and age should be displayed in the respective form boxes.(example name should be displayed in name: )</p>

<p>How can i do this? any suggestions or some good tutorials relating to the following will be highly appreciated.</p>

<p>Thanks for your time. John</p>
