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

Link to comment
Share on other sites

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> 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.