943,177 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 36
  • PHP RSS
Sep 1st, 2010
0

Quick question about form input?

Expand Post »
Hey, just a quick question about the following code:

PHP Syntax (Toggle Plain Text)
  1. <input name='name' type='text' class='form' value='<?php echo "" . (isset($_REQUEST['name'])) ? dataClean(ex_clean($_REQUEST['name'])) : FALSE . "";?>' size="40" rows='5' />

Now, if the user has errors in the form details and clicks submit, the page refreshes and it displays what errors need fixing, but it keeps the data that the user filled in.

Can anyone tell me how to go about adding a peice of code to this to make it so that it will keep the data with a regular page refresh?

I got some help with this the other day, but can't figure out how to do it with the PHP being used here.

Any ideas?

Basically I was the form to stay with all the inputs filled in after a regular page refresh. I know there's alot of help with this floating around but I couldn't find anything specific enough.

Any help appreciated
Similar Threads
Reputation Points: 10
Solved Threads: 1
Junior Poster in Training
ello is offline Offline
66 posts
since Aug 2010
Sep 1st, 2010
0
Re: Quick question about form input?
Are you looking for the ability to stop entering part way thru filling the form, refresh the page and whatever you entered has been retained? If so, then you need to look into some javascript to save the values as soon as you complete each field.
Reputation Points: 210
Solved Threads: 228
Nearly a Posting Virtuoso
chrishea is offline Offline
1,389 posts
since Sep 2008
Sep 1st, 2010
0
Re: Quick question about form input?
Click to Expand / Collapse  Quote originally posted by chrishea ...
Are you looking for the ability to stop entering part way thru filling the form, refresh the page and whatever you entered has been retained? If so, then you need to look into some javascript to save the values as soon as you complete each field.
Thanks for the reply. Yeaph pretty much. I was just wondering if there was a way to do it with PHP using the example I gave. Any way to do this with PHP?
Reputation Points: 10
Solved Threads: 1
Junior Poster in Training
ello is offline Offline
66 posts
since Aug 2010
Sep 1st, 2010
0
Re: Quick question about form input?
[QUOTE=ello;1322003]Thanks for the reply. Yeaph pretty much.

I actualy decided to search this site for any people with the same problem [should have done it before, i know] but I came across this:

PHP Syntax (Toggle Plain Text)
  1. <input type='text' name='name' value=<?php echo $_REQUEST['name']; ?>>

I may give something like this a try.

Anyone know how I could get something like this to work along side the other code I have? Tried it, but nothing seems to work.
Last edited by ello; Sep 1st, 2010 at 8:25 pm.
Reputation Points: 10
Solved Threads: 1
Junior Poster in Training
ello is offline Offline
66 posts
since Aug 2010

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: [Help Please]Weird influent variable problem, I would love some input!
Next Thread in PHP Forum Timeline: Looking for help on output rows in a table





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC