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

by Complex <complex_hwg(at)yahoo.com>

 Date:  Fri, 30 Nov 2001 08:22:14 -0800 (PST)
 To:  HWG Techniques <hwg-techniques(at)hwg.org>
 In-Reply-To:  trudi
  todo: View Thread, Original
I may have been too tired to write an understandable post the first
time around.

My initial problem, to be blunt, appears to be customers who have
turned JavaScript off. Thus, in my test page, I have replaced the
Submit button with a graphic linked to the destination page. No matter
what, clicking on the Submit "button" will send the user to the
destination page, which I judge to be the most important thing to my
company.  That part of the solution works fine.

My secondary problem, however, still looms.
	I need to tell the form to submit itself to my form-processing cgi.
a) I can't use a Submit button or other Input button b/c linking those
does not work. As someone pointed out to me, a single click will only
do a single thing-- submit the form, in this case. In the <a
href="http://www.scanalytics.com/product/download/downloadEntry.html">real,
non-test script</a>, I use a JavaScript to open the destination page in
a new window. That works fine, too, except for my non-JS customers who
I'm really spending too much time on!
b)  I'm willing to use JavaScript to tell the form to submit itself. IF
the customer turns off JS, they'll still get the result page, even if
we don't get their info. Oh, well, life goes on.  So I figured I'd put
an onClick handler in the link to the destination page. Unfortunately,
that doesn't work. Again, I guess the link can only do one thing-- send
you to the next page.
c)   I tried using an onUnload handler to submit the form, but that
didn't work either. You're really not supposed to use onUnload for
lengthy processes, so I shouldn't be surprised that this failed.


It's been suggested that I use setTimeout... When I get the chance,
I'll see if I can use that to submit the form.

People have also pointed out a number of problems with the test-page...
red herrings, really. 
# Yes, the image doesn't look like a submit button-- but it was lying
around. If I end up using an image for the final page, I'll make an
image of a submit button.
# Yes, I could use the form to load the destination page. That's quite
easy, and it's what we did in the past. I got tired of my ISP's server
having occasional hiccups which prevented the customers from getting to
the destination page. Nothing should get in the way of these customers.
(At the very least, it focuses undesirable attention on the Webmaster.
:-) I got around this by using the onClick=window.open(...) handler
inside the non-test-page's Submit button.
# Yes, I could ask the aliens for help, but not until they give me back
my sister.

Thanks again for the help,
 complex

__________________________________________________
Do You Yahoo!?
Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1

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