Html POST and return the same form with the values
Posted
by vtortola
on Stack Overflow
See other posts from Stack Overflow
or by vtortola
Published on 2010-05-19T23:18:38Z
Indexed on
2010/05/19
23:20 UTC
Read the original article
Hit count: 238
Hi,
I'm learning web development, and I don't know how do this simple thing.
I've a html form with "text", "radio" and "checkbox" controls, that POST the values to the server and it saves them, for example in a file. I save the POST in raw format:
key=value&key=value&key=value&key=value
and I'd like that when the user open the form back, return the form with the saved values already in the controls.
Is there any neat way to do this? Or should I parse the POST string and set the values one by one in the controls at the server level?
I think, I could return the saved data in a hidden input control, and after with a javascript I could do a getElementById(key) and set the value to each input control... but do I need to put the post string in a special format?
How would you do it?
Thank you in advance.
© Stack Overflow or respective owner