I am trying to get a zip code lookup script to work. Basically, I want the user to input a zip code and the city and state are displayed without using a button to find it. I already have a zip code table in mysql. if i manually enter the ?zip= into the url, the city and state are displayed. my problem is getting the input into the url.
any suggestions on where to look for solutions?
here is my javascript function (which is probably where my problem is...i'm not well versed in js)
Expand|Select|Wrap|Line Numbers
- function checkZip() {
- var url = 'ContactEntryForm.php?zip=';
- var search = form.contactEntry.getElementById('zip').value;
- window.location.href='url+search';
Expand|Select|Wrap|Line Numbers
- print "<tr><td>Zip</td><td><input type='text' name='mzip' id='zip' onchange='checkZip();' /></td>";