Lisa23 Posted October 13, 2011 Share Posted October 13, 2011 Hi i have the above javascript that if retrun true directs the user to the next page but some how on safari the return true only working once <script type="text/javascript"> function checkAgent() { if (document.getElementById('agent_select').value=='none') { alert('Select Web TV'); return false; } return true; } </script> my site is http://www.estateagentsonfilm.co.uk/builders.php the drop down is the (select web tv) then click on (click here) if you do it twice the send time doesnt work but only on safari any reason why? <form id="agents" action="agents_jump.php" onsubmit="return checkAgent();" method="post" target="_blank" name="agents" style="margin:0;"> Quote Link to comment https://forums.phpfreaks.com/topic/249079-javascript-return-true-only-working-once-on-safari-but-other-browsers-works/ Share on other sites More sharing options...
Lisa23 Posted October 14, 2011 Author Share Posted October 14, 2011 Hi i thsi is a simple example of my issue if you test this script on safari by selecting the from the drop down twice you'll notice that second time it doesnt work but if you test on a differnt browser it works any help would be much appreciated <html> <head> <script type="text/javascript"> function checkAgent() { if (document.getElementById('agent_select').value=='none') { alert('Select Web TV'); return false; } return true; } </script> </head> <body> <form id="agents" action="agents_jump.php" onsubmit="return checkAgent();" method="post" target="_blank" name="agents" style="margin:0;"> <select name="agents" id="agent_select" size="1" style="width:160px; font-size:13px;">> <option value="none">Volvo</option> <option>Saab</option> <option>Mercedes</option> <option>Audi</option> </select> <input class="view_agents" id="tvoption" type="image" src="images/viewagents.gif" alt="TV OPTION" name="tvoption" border="0" onclick="jwplayer().stop();"> </form> </body> </html> Quote Link to comment https://forums.phpfreaks.com/topic/249079-javascript-return-true-only-working-once-on-safari-but-other-browsers-works/#findComment-1279207 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.