Re: Opening a page & submitting a form at same time, Lo-tech style

by Robin Liston <rliston(at)home.com>

 Date:  Thu, 29 Nov 2001 23:49:45 -0800
 To:  hwg-techniques(at)hwg.org
  todo: View Thread, Original
I thought onClick was a JavaScript event.

You could try

<!--
<FORM name="Trade_Info4Downloads" method="post" action="destination.html">
  <INPUT type="image" border="0" name="imageField" src="arrow4.gif"
width="32" height="32">
</FORM> 
-->

but it isn't going to process the form. Besides, you don't want the user to
be able to look at your code and figure out how to get the destination page
without filling out the form. You want them to fill out the form then go to
the destination page, which is why the destination page is "hidden" in the
CGI. You might want to talk to your ISP about why the CGI form handler is
taking so long to return the destination page.

You can write your own form "handler" in ASP, but ASP is server side and
your ISP would have to have it installed on their server.



At 12:38 PM 11/29/2001 -0800, you wrote:
>I am trying to open a page and submit a form with one click of a submit
>button or link.
>
>That would be easy, but I am also making the following restrictions:
>	1) Don't use the CGI to open the web page, because the ISP's server
>has had problems in the past and not returned the "load this page"
>result in a reasonable amount of time.
>	2) Don't use JavaScript to open the page because I'm tryinng to work
>around customers who either don't have JavaScript activated or who are
>running into some weird JS problem that I haven't identified.
>
>Yah, that's overly restrictive. I'll tell customers that JavaScript is
>required, but only if I really really have to.
>
>This is my failed attempt (I changed the file names for brevity):
>
>< a href="destination.html" 
>onClick="Trade_Info4Downloads.submit(); return true;">
>< img src="arrow4.gif">< /a>
>
>That will open the destination page, but it doesn't submit the form.
>You can see the above script at:
>http://www.scanalytics.com/webtest/downloadEntry_onClick.html
>
>It seems like the link is acting before the onClick handler can act. I
>also tried putting the submit method in the body tag's onUnload
>handler.
>Hmmmm, I can't tell if submit() is working at all!
>
>
>Ugh. Can someone please tell me how I should go about this? (Assuming
>there's a way other than telling the user what I require of them)
>
>TIA
>
>__________________________________________________
>Do You Yahoo!?
>Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
>http://geocities.yahoo.com/ps/info1
>
====================================================================
This sig has been sanitized for your convenience.  -Me
====================================================================

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA