I have two fields:
<input type="text" name="zip" id="zip" value="" />
<select name="state" id="state">
<option value="XX">Outside USA/Canada</option>
<option value="AL" selected>Alabama</option>
<option value="AK">Alaska</option>
</select>
I want to have zip code and state selected based on ip address of visitor.
its means everytime use visit this page in zip code filed there should be zip of visitor (based on ip) and state selected (based on ip)..
We can use some javascript function onload event of body or something like this, I am not sure. What may be the best way to do this?
You can find a user’s ZIP code and city based on their IP using IP2Location.