Html POST and return the same form with the values
- by vtortola
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.