Forum Moderators: open

Message Too Old, No Replies

Submitting a form upon selecting a menu option

         

jstam

9:18 pm on Jun 12, 2005 (gmt 0)

10+ Year Member



I am trying to create a dynamic form that updates itself as the user selects options from various menus. I intend to do this with PHP, and to have the form action be set to the same .php file it is located in. Using the variables that are set, it will print out new form items.

Unfortunately, I don't know how to trigger a submit when a menu option is selected. Does anyone have any suggestions?

Thanks!

BlobFisk

8:05 am on Jun 13, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi jstam,

This can be achieved by firing a javascript funtion using the onChange event handler:

<select id="select_ID" onChange="submit_form()">

However, I would caution against using this from a usability perspective. If the user selects the wrong option by mistake you are forcing them into the situation whereby they have submitted the form with incorrect information...