|Hooking in the Web form|
<form> <p>City: <input type="text" name="city" id="city" size="25" onChange="callServer();" /></p> <p>State: <input type="text" name="state" id="state" size="25" onChange="callServer();" /></p> <p>Zip Code: <input type="text" name="zipCode" id="zipCode" size="5" /></p> </form>If this feels like yet one more piece of fairly routine code, then you're right -- it is! When a user puts in a new value for either the city or state field, the
callServer()method fires off and the Ajax fun begins. Starting to feel like you've got a handle on things? Good; that's the idea!
Validator and Debugger!