Jump to content

Form trouble.


sepoto

Recommended Posts

 <form id="addressForm" action="/" style='text-align: left;'>	<div style=''>	<div style='text-align: left;'>	  <label for="address">Address:</label><Br>	  <input type="text" name="address" id="address" style='width: 300px;' /><br>	  <label for="radius">Radius:</label><br>		  <select name="Radius" size="1" style='width: 300px;'>	<option value="5" selected>5</option>	<option value="10">10</option>	<option value="50">50</option>	</select><br></div>	  <input type="submit" id="addressButton" value="Get Bars" />	</div>  </form>

In my header I have this:

   form.onsubmit = function() {	  // Getting the address from the text input	  var address = document.getElementById('address').value;	  var dist = document.getElementById('dropdown').value	  // Making the Geocoder call 	  getCoordinates(address);	  	  // Preventing the form from doing a page submit	  return false;	  	}

With action="/" the form used to work perfectly. I was busy making some modifications inside getCoordinates(address); when I noticed the Get Bars button no longer did what it was supposed to and started redirecting me to some other page. I don't know how to fix this. Does anyone know what might be happening?Thank you

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...