Re: Opening a page & submitting a form at same time, Lo-tech style
by Kukla Fran and Ollie <weblists2001(at)yahoo.com>
|
Date: |
Fri, 30 Nov 2001 20:07:39 -0800 |
To: |
HWG Techniques <hwg-techniques(at)hwg.org> |
Cc: |
Complex <complex_hwg(at)yahoo.com> |
References: |
trudi |
|
todo: View
Thread,
Original
|
|
You are forgetting two fundamental issues:
1) JavaScript is not a CGI. While you can make it appear to do the work
of a CGI on your page, it doesn't do anything in real life. The actual
form action is just to send you to the destination page, and nothing
else. Whatever JavaScript manipulations you do to the form contents is lost.
2) In order to submit email information on a web form, you still require
some sort of CGI script in the background to actually send the email to
you. That someone suggested the amateur mailto: in a different email means
using a *user's* apparent email capabilities to do the work of the CGI you
do not have in the first place.
Nothing personal but if JavaScript had the ability to do what you think it
does, that script would be available to all long ago. That there is no
such script out there should tell you something. :)
At 08:22 AM 11/30/01 -0800, Complex wrote:
>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!?
Get your free (at)yahoo.com address at http://mail.yahoo.com
HWG hwg-techniques mailing list archives,
maintained by Webmasters @ IWA