Jump to content

javascript return true only working once on safari but other browsers works


Lisa23

Recommended Posts

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;">

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> 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.