Skip to content Skip to sidebar Skip to footer

Dependent Dropdown Lists With Go To Url Button

Trying to create two dropdown lists where the 2nd has a dependency on the first, and the second contains URL values with a GO button that goes to the URL. For example - choose from

Solution 1:

The issue here likely has to do with when/how JSFiddle injects the script you defined in the js section. Opening the console, and clicking submit it said that the function wasn't defined, meaning at the time the submit button was created it had no idea what that function was.

To prove this is, I moved the definition of that function to html, before the submit button and it works.

<script>functionyourfunction(){} </script><form><!-- yourfunction guaranteed to be defined here --><buttononclick="yourfunction()"></button></form>

DEMO: https://jsfiddle.net/p2qwngxe/1/

Post a Comment for "Dependent Dropdown Lists With Go To Url Button"