[thelist] Call a CGI from within a form without submitting the from

Matt Warden mwarden at gmail.com
Thu Jun 30 14:45:10 CDT 2005


On 6/30/05, raanders at mailporter.net <raanders at mailporter.net> wrote:
> Just subscribed but have searched the archives and found only one
> message ( that never got a reply ) that came close to what I'm trying to do.
> 
> Here is what I've what I've got _mostly_ working ( on a site not ready
> for public consumption ).
> 
> User is filling out a signup form , which for my sanity gets all their
> information ( including CC information ) in one form.
> 
> One field is a "desired" username.  Before having them submit the form
> they are able to click a <button><Check/button> with an onClick
> attribute/action calls a Javascript function that 1) updates fields in a
> "hidden" form ( all inputs are type="hidden" ) from specific main form
> fields the does a document.forms['formname'].submit();
> 
> The "hidden" form has an action to call the CGI ( perl script ) to d
> other checking username availability and offer some alternatives if it
> is taken.  It also has an onSubmit attribute/action that calls another
> Javascript function that opens a new window that is suppose to be be
> smaller in size and without the normal bells and whistles.
> 
> So the "not for public" site works except for the minimized sized window
> -- it is full/default sized.
...
> Any suggestions or pointers are appreciated.

Hi Rod,

I think you are going about this the wrong way. This is a great
situation to use (even though I hate the acronym) AJAX. I actually
have something similar to what you want in an AJAX example in my
sandbox:

http://mwarden.f2o.org/sandbox/ajax.htm

The AJAX-specific code is actually quite immature relative to what I
use now, but it does work.

Note that one of the reasons this is a good use of AJAX is that it is
an 'extra' and isn't necessary for the form to work.

HTH,

-- 
Matt Warden
Miami University
Oxford, OH, USA
http://mattwarden.com


This email proudly and graciously contributes to entropy.


More information about the thelist mailing list