PDA

View Full Version : filling in form fields


Nightfire
09-10-2002, 03:52 PM
How do you prefil forms with information the user has filled in days ago? It's a profile edit page so it has to show all their info in the form fields.

I tried

<input type="text" name="blah" value="<?=$name?>">

<input type="text" name="blah" <?=$name?>>

But none of these work, they only show in the source?

Spookster
09-10-2002, 05:45 PM
<input type="text" name="blah" value="<?php echo $name ?>">

dreamingdigital
09-10-2002, 05:46 PM
try this:
<?php
print "<input type=text name=address value=$address>";
?>

works for me

Colin Puttick
Webmaster
www.dreamingdigital.ca

Nightfire
09-10-2002, 05:48 PM
Nevermind, I realised what I was doing :o

I was trying <textarea name="blah" value="<?=$name?>"></textarea> :o

Been a long day today

Nightfire
09-11-2002, 09:41 PM
Different question, but same sort of thing, so I'll post it here.

If someone's submitted a form to find out after submitting they've not added their name and have to go back and fill it in, how can I prevent the form from losing all it's info when the user clicks back?

The reason is that it's for a story and if someone forgets to add their name on the form, their story isnt submitted, so when they click back all their story is gone from the textarea (which may have taken upto 20 mins to type). Is there any way to prevent this info being lost?

Spookster
09-12-2002, 12:47 AM
There is not guarantee that when they click the back button that the browser will send out a request to the server. Depends on how their browser is configured.

Would probably be better to take them to a preview page. Kind of like what this forum has where you can preview your reply before it is actually posted. If they need to edit something then supply them with a button to do so which would take them to a form with the info filled back in. That would ensure a request is sent to the server.

Nightfire
09-12-2002, 01:33 AM
Ahh, thanks :) I guess that would be the best way overall too.

codewarrior
09-12-2002, 05:15 AM
While were discussing this topic, can we restrict how much can they put in? If yes, how so?

Spookster
09-12-2002, 06:00 AM
Restrict how much of what can be put in where?