Help in my form

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jauson
Forum Contributor
Posts: 111
Joined: Wed Oct 05, 2011 12:59 am

Help in my form

Post 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.
Gopesh
Forum Contributor
Posts: 143
Joined: Fri Dec 24, 2010 12:48 am
Location: India

Re: Help in my form

Post by Gopesh »

Hi,Pls show the working code..
jauson
Forum Contributor
Posts: 111
Joined: Wed Oct 05, 2011 12:59 am

Re: Help in my form

Post 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!
Gopesh
Forum Contributor
Posts: 143
Joined: Fri Dec 24, 2010 12:48 am
Location: India

Re: Help in my form

Post by Gopesh »

Can u pls explain in more detail way? didn't understand what u exactly means?
jauson
Forum Contributor
Posts: 111
Joined: Wed Oct 05, 2011 12:59 am

Re: Help in my form

Post 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
Gopesh
Forum Contributor
Posts: 143
Joined: Fri Dec 24, 2010 12:48 am
Location: India

Re: Help in my form

Post 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'];}   ?>" />
jauson
Forum Contributor
Posts: 111
Joined: Wed Oct 05, 2011 12:59 am

Re: Help in my form

Post by jauson »

Hi

sorry for bad english.,
yes to retain the values in the form. thank you so much!
Post Reply