Skip to content Skip to sidebar Skip to footer

Dropdown Menu Doesn't Function

my problem is when i select the monthly part, the next drop down menu doesn't come out. the first drop down is work well but when i select the first selection it does not display a

Solution 1:

Remove id or type

<select name="selection">
<option value="">--Select--</option>
<option value="1">Monthly</option>
<option value="2" >Yearly</option>  
</select>

Solution 2:

It appears that you want the second dropdown once you have selected the first - to get it you must submit the page - the crudest way would be to put that onto the first dropdown's onChange event. Make sure you have a form to submit.

<formname="form"id="form"action="your_sql_page.php"method="get"><selectname="selection"onChange="submit();"><optionvalue="">--Select--</option><optionvalue="1">Monthly</option><optionvalue="2">Yearly</option></select></form>

How to submit form on change of dropdown list?

It would probably be best to have the second dropdown triggered by JavaScript - unless you are worried about not being dependent on JavaScript as per the comments on the reference page.

If you are using php it needs to be submitted to the server - this reference explains the process: Don't know how to solve (Between Php and Javascript)

The form's action could be to submit to itself - you will need to add onChange and submit() to the second dropdown

     echo '<selectname="yearly"onchange = "submit()">';

and add code that will make the page respond differently, depending on what has been submitted - wrap it in an if(isset(...

action="<?phpecho %_SERVER["PHP_SELF"]; ?>"

As per @Rahautos do remove id and type.

Post a Comment for "Dropdown Menu Doesn't Function"