[LRUG] Geocoding and form submission

Alex Young alex at blackkettle.org
Fri Apr 10 03:55:53 PDT 2009


Andrew Stewart wrote:
> 
> On 10 Apr 2009, at 11:42, Dan Webb wrote:
> 
>> Sounds like that to me as well.  You'll probably need to return false
>> from the initial submit handler then wait for the gecode service to
>> return then re submit the form by calling submit() on it.
> 
> Thanks for the suggestion.
> 
> I already tried that and it worked well.  However I then got in a tangle 
> over when my geocoding callback should (re-)submit the form and when it 
> shouldn't, because the geocoding could also be invoked when leaving the 
> address field and that in itself shouldn't submit the form...so I backed 
> it out.  Anyway, I'll have another go with this approach.
> 

An alternative would be to replace the submit button with an <input 
type="button"> so that the submission is entirely under your control. If you 
don't have to worry about non-JS fallback (which it sounds like is a 
non-problem) that should be worth a try.

-- 
Alex



More information about the Chat mailing list