Jquery form submit on select not working

Chopharry

New Member
This piece of jquery code is suppose to execute a form submit on a drop down select. It works on our test site.But as soon as we publish it to our live website, it breaks. Can anyone see if there is anything wrong with it?(ASP / Execute code below) PAGE: http://www.casa.gov.au/scripts/nc.dll?WCMS:PWA::pc=PC_91330THE ASP CODE: \[code\]<script> $(document).ready(function() { $(document).on("change","select#state",function(e){ $("form").submit(); }); });</script> <form action="avsafety.asp" method="get"> <p>State:<br/> <select id="state" name="state"> <option label="ACT" value="http://stackoverflow.com/questions/14512030/ACT" <%if request.querystring("state") = "ACT" then response.write("selected") %>>ACT</option> <option label="NSW" value="http://stackoverflow.com/questions/14512030/NSW" <%if request.querystring("state") = "NSW" then response.write("selected") %>>NSW</option> <option label="NT" value="http://stackoverflow.com/questions/14512030/NT" <%if request.querystring("state") = "NT" then response.write("selected") %>>NT</option> <option label="QLD" value="http://stackoverflow.com/questions/14512030/QLD" <%if request.querystring("state") = "QLD" then response.write("selected") %>>QLD</option> <option label="VIC" value="http://stackoverflow.com/questions/14512030/VIC" <%if request.querystring("state") = "VIC" then response.write("selected") %>>VIC</option> <option label="SA" value="http://stackoverflow.com/questions/14512030/SA" <%if request.querystring("state") = "SA" then response.write("selected") %>>SA</option> <option label="TAS" value="http://stackoverflow.com/questions/14512030/TAS" <%if request.querystring("state") = "TAS" then response.write("selected") %>>TAS</option> <option label="WA" value="http://stackoverflow.com/questions/14512030/WA" <%if request.querystring("state") = "WA" then response.write("selected") %>>WA</option> </select> <input type="submit" value="http://stackoverflow.com/questions/14512030/Search" /> </p> </form>\[/code\]THE CODE ON THE LIVE WEBSITE:\[code\]<script type="text/javascript"> $(document).ready(function() { $(document).on("change","select#state",function(e){ $("form").submit(); }); });</script><form action="avsafety.asp" method="get"> <p> State:<br /> <select id="state" name="state"> <option label="ACT" value="http://stackoverflow.com/questions/14512030/ACT"> ACT </option> <option label="NSW" value="http://stackoverflow.com/questions/14512030/NSW"> NSW </option> <option label="NT" value="http://stackoverflow.com/questions/14512030/NT"> NT </option> <option label="QLD" value="http://stackoverflow.com/questions/14512030/QLD"> QLD </option> <option label="VIC" value="http://stackoverflow.com/questions/14512030/VIC"> VIC </option> <option label="SA" value="http://stackoverflow.com/questions/14512030/SA"> SA </option> <option label="TAS" value="http://stackoverflow.com/questions/14512030/TAS"> TAS </option> <option label="WA" value="http://stackoverflow.com/questions/14512030/WA"> WA </option> </select> <input type="submit" value="http://stackoverflow.com/questions/14512030/Search" /> </p><input type="hidden" name="session" value="http://stackoverflow.com/questions/14512030/1918276309" /></form>\[/code\]
 
Back
Top