Page 1 of 1
Help in my form
Posted: Mon Jan 16, 2012 9:43 pm
by jauson
What should i do in my html form ?
i want to add new data in my form with required fields..
when i click submit i got an error for example username should not empty but all the data that i inputted is gone. what should i do to make my data not going to out.
Re: Help in my form
Posted: Mon Jan 16, 2012 10:26 pm
by Gopesh
Hi,Pls show the working code..
Re: Help in my form
Posted: Mon Jan 16, 2012 10:40 pm
by jauson
heres
<html>
<form action="" method="">
firstname<br>
<input type="text" name="fname" required><br>
<lastname<br>
<input type="text" name="lname" required>
Middle name<br>
<input type="text" name="mname">
</form>
</html>
I want the data I input is still in there when i got error in the required field.
thanks buddy!
Re: Help in my form
Posted: Mon Jan 16, 2012 11:31 pm
by Gopesh
Can u pls explain in more detail way? didn't understand what u exactly means?
Re: Help in my form
Posted: Mon Jan 16, 2012 11:49 pm
by jauson
Hi Gopesh
is that possible? I will sign up into my form and when I click i click saved. It goes back to a fresh form with nothing inside onto form.
BUT
what if I sign up again, then i click saved. but i forgot to input some important field. definitely the form goes back to a fresh again. what if i had 100 fields on my form
and it goes to blank fields again. i dont want to happen that.. thats why i want my field just like a cache it will not be blank everytime i had missed an required fields. do you get me? thanks
Re: Help in my form
Posted: Tue Jan 17, 2012 12:14 am
by Gopesh
Hi,hope that u need to retain the values in the form. pls check this code
Code: Select all
<input type="type" style="width:72px;"name="refno" value="<?php if(isset($_REQUEST['refno'])) { echo $_REQUEST['refno'];} ?>" />
Re: Help in my form
Posted: Tue Jan 17, 2012 12:58 am
by jauson
Hi
sorry for bad english.,
yes to retain the values in the form. thank you so much!