Perl Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPerl Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old November 20th, 2000, 03:10 PM
smmorrow smmorrow is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2000
Location: Pennsylvania, USA
Posts: 37 smmorrow User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 24 m 15 sec
Reputation Power: 9
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

Reply With Quote
  #2  
Old November 21st, 2000, 01:27 AM
xeon xeon is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2000
Posts: 9 xeon User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #3  
Old November 21st, 2000, 07:53 AM
smmorrow smmorrow is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2000
Location: Pennsylvania, USA
Posts: 37 smmorrow User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 24 m 15 sec
Reputation Power: 9
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!


Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > form.submit in Perl cgi script - Netscape error


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway