[eluser]JamesTaylor[/eluser]
How would i have some javascript execute once a particular field of a form has been filled in?
I currently have a form field which takes in a postcode, i then have a button which when pressed takes the postcode data executes some javascript and returns the latitude and longitude of the postcode. What i would like to achieve is for the javascript to be executed when the postcode form field is completed / cycled thro to the next field.
At the min my button which triggers the action has the following code:
Code:
<input type="image" value="Show Lat/Lng" o n C l i c k ="usePointFromPostcode(document.getElementById('postcode').value, showPointLatLng)" />
** NB - spacing added to onClick so it will display here.
and the form field which i want to trigger the javascript current is:
Code:
<label for = "postcode">Postcode:</label>
<input id="postcode" name="postcode" type="text" value=""/>