1,105,578 Community Members

Textfield empty after submitting the form

Member Avatar
bavenbabu
Junior Poster in Training
60 posts since Feb 2012
Reputation Points: -6 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
-1
 

i am a new to php.i am having a trouble that whenever i typed a wrong username in the textfield the field goes blank after its submission...I need the field values there such i need not want to insert the textfield value again.so how can i avoid such problem...i appreciate any help...

Member Avatar
simplypixie
Practically a Master Poster
673 posts since Oct 2010
Reputation Points: 123 [?]
Q&As Helped to Solve: 122 [?]
Skill Endorsements: 6 [?]
 
0
 

In the value of each form field you need to echo the posted data, for example

<input type="text" name="username" value="<?php if (isset($_POST['username'])) { echo $_POST['username']; } ?>">
Member Avatar
bavenbabu
Junior Poster in Training
60 posts since Feb 2012
Reputation Points: -6 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
0
 

i am a new to php.i am having a trouble that whenever i typed a wrong username in the textfield the field goes blank after its submission...I need the field values there such i need not want to insert the textfield value again.so how can i avoid such problem...i appreciate any help...

thanks for the help...it really helped me a lot...it solved ma problem

Question Answered as of 2 Years Ago by simplypixie
Member Avatar
bavenbabu
Junior Poster in Training
60 posts since Feb 2012
Reputation Points: -6 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
0
 

thanks for the help...it really helped me a lot...it solved ma problem

i got the answer
<?php
if(isset($_get))&&($_get==' ')
{
echo 'userfield is blank';
}
?>

You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article