[LRUG] Geocoding and form submission

Dan Webb dan at danwebb.net
Fri Apr 10 04:23:06 PDT 2009


On Fri, Apr 10, 2009 at 11:58 AM, Andrew Stewart
<boss at airbladesoftware.com> wrote:
>> 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.

That's not a good solution.  Aside from the form not being submittable
without JS, there are other problems associated.  Your forms won't
submit when you press return as many users expect.  Don't ever change
the mark up from what it should be just because you want to get a
particular effect with JavaScript.  Especially in this case where
there is no need at all.

A possible more solid way of architecting something like this is to
have the gecoding service go through your application and you get the
result via Ajax.  Then if the form is submitted without that field
being gecoded then your application can do the geocoding...then you
get your non-JS fallback for free.

-- 
Dan Webb
http://www.danwebb.net

aim: danwrong123
skype: danwrong



More information about the Chat mailing list