|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
|||
|
|||
|
I regularly make use of the technique of building and automatically submitting forms within a cgi-script. This is done to switch from one script to another when there is processing that has to be done after the last "physical" form submit - and to prevent providing parameters via a URL string (making them hidden fields instead).
My problem is that when this is done, I get an error in Netscape - 'transfer interrupted'. It still continues, but the message is confusing to the visitor. Does anyone know a way around this? Example: A person submits credit card information on a screen. My script needs to save that information before moving on to the credit card processor - but we don't want to display another intermediate form. So - I save the information, then build a form with hidden fields, and do a javascript form.submit to automatically submit it the the Credit Card processor. This works fine in IE (and WORKS in Netscape except for the fact that a 'Transfer Interrupted' message appears on the page). Any suggestions? I've tried putting a delay timer on the form.submit - but that doesn't help. Thanks, Sharon |
|
#2
|
|||
|
|||
|
this message appear in Netscape if you interrupted generation of document. probably, you call fuction which submits form within body of document, for example after definition of form. try to place call to event handler of document. i mean call your function by event 'onLoad' on body of document. little example:
<script language="JavaScript"> function submitForm() { var f = document.forms["myForm"]; ... f.submit(); } </script> <body bgcolor="#FFFFFF" onLoad="submitForm()"> ... <form name="myForm" action="..."> ... </form> ... </body> ------------------ xeon |
|
#3
|
|||
|
|||
|
Thanks xeon! I tried it in one of my smaller scripts and it worked! To be honest, it didn't make sense to me that it would work - because if you submit the form on the load of the body - it didn't seem like it would have the data loaded in the hidden fields within the form. What I had been doing was simply executing the javascript form.submit AFTER the end body tag (after $q->end_html). That seems like it would not be interrupting the document doing it that way - but apparently it was.
Thanks again! I'll try this in some of my other scripts and will let you know if it doesn't work anywhere. You're a life saver! |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > form.submit in Perl cgi script - Netscape error |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|