/    Sign up×
Community /Pin to ProfileBookmark

Keep field value after submitting

Could you tell me how I can do so that the value of the field remained after that form is submitted? Now when I press on the Submit button and come back, my fields’ values become blank.
Thank you.

to post a comment
PHP

5 Comments(s)

Copy linkTweet thisAlerts:
@Shanu_chaudharyApr 22.2008 — The same problem I faced so far....

Do this....

<option name = 'somename' value = 'L'" <?if ($_POST['sort'] == 'L'){ "selected" }>Display Name</option>

Same for the other options...

Hope this helps...
Copy linkTweet thisAlerts:
@harevik85authorApr 22.2008 — Sorry I didn't understand well what you wrote, could you please write what to do for the following input?

<input type='text' name='q_name'>
Copy linkTweet thisAlerts:
@Shanu_chaudharyApr 22.2008 — Ok..I thought it is for Dropdown...

For text box...Try this..............

[CODE]<?php?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</HEAD>
<?
$test = $_POST['q_name'];
?>
<BODY>
<form name = "test" method = "POST">
<input type='text' name='q_name' value = <?echo $test?>>

<INPUT TYPE="submit" value = "Submit">
</form>
</BODY>
</HTML>[/CODE]
Copy linkTweet thisAlerts:
@harevik85authorApr 22.2008 — So simple...... thanks a lot, it worked??
Copy linkTweet thisAlerts:
@Shanu_chaudharyApr 22.2008 — So simple...... thanks a lot, it worked??[/QUOTE]
Welcome....?
×

Success!

Help @harevik85 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...