- Impact
- 18
Sorry about the vagueness of the title, but I have a problem.
I have a form that includes <select> boxes. Now when a user submits this form it goes to a php page where it either sends an email to me includng the values in the form, OR it reports an error to the user and display's the form again. Now, unlike normal text inputs (<input type="text">) the "value" attribute cannot be used here (as in <select value="<?php echo $hosting; ?>">) I assume. So is there an easy way to have the chosen option displayed automatically?
Normally you would put <option selected value="..">...</option>, but I hoped I didn't have to create php functions to output <select> boxes with the right option selected.
Please say there is an easy way! :lol: I hope you understand!
Thanks a lot
Tom
I have a form that includes <select> boxes. Now when a user submits this form it goes to a php page where it either sends an email to me includng the values in the form, OR it reports an error to the user and display's the form again. Now, unlike normal text inputs (<input type="text">) the "value" attribute cannot be used here (as in <select value="<?php echo $hosting; ?>">) I assume. So is there an easy way to have the chosen option displayed automatically?
Normally you would put <option selected value="..">...</option>, but I hoped I didn't have to create php functions to output <select> boxes with the right option selected.
Please say there is an easy way! :lol: I hope you understand!
Thanks a lot
Tom















