populate HTML field from Hidden Field Value

323 Views Asked by At

I have 2 forms. On the first form I want to place the username in a hidden field. Then, on the second form I want to use that user name as the value of username field.

<form method="POST" name="form1" id="don_form1">
        userName:<input type="text" name="uname">
        Email:<input type="text" name="fname">
        password:<input type="password" name="fname">
        <input type="submit" name="submit_btn1" id="btn1"/>
</form>

<form method="POST" name="form2" id="don_form2">
        userName:<input type="text" name="uname">
        Age:<input type="text" name="fname">
        Country:<input type="text" name="fname">
        <input type="submit" name="submit_btn2" id="btn2"/>
</form>

So, on the second form I don't want the user to his user name again, as this field should be populated on its own. The forms are on 2 different pages of Wordpress.

0

There are 0 best solutions below