• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

IE and Netscape

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have a form wich needs to be submitted using a Javascript. The condensed code is as follows:
<html>
<head>
<script language='javascript'>
function doit()
{
document.f.action = "path of the cgi";
document.f.submit();
alert("Your information has been sent to the Admissions dept");
addr = "redirection addr";
window.location=addr;
return true;
}
</script>

<title></title>
</head>
<body bgcolor="#FFFFDD" link="#0000FF" vlink="#0000FF">

<hr><form METHOD="post" name="f">
<INPUT TYPE="hidden" NAME="mailform_addresses" VALUE="abc@abc.edu">
<INPUT TYPE="text" NAME="addr" value="">

<INPUT TYPE=button NAME="button" VALUE="Submit your Registration"
onClick="return doit();">  <input type="reset" name="reset" value="Reset Form"><BR><BR>
</CENTER></form>
<br><br>
</body>
</html>

The CGI mails the form field contents to the address in the hodden field.
This form works fine in Netscape. But, it fails to work as desired in IE. It calls the Javascript and even displays the laerts. But, it does not call the CGI and does not open the redirection page properly.
This is kind of urgent so it would be really nice if someone could get back to me with a possible solution.
Thanks,
Varsha.
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In IE you will need to use window.navigate(URL) or window.location.replace(URL).
 
Varsha Redkar
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Tried it...but it still does not work. The CGI is not executed at all...
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This may be a silly question, but can you invoke the CGI program by typing it directly into the address bar?
 
Varsha Redkar
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am not the person using the CGI.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Now I'm really confused . If you are not the person using the CGI, then how do you know that it isn't being executed from your Javascript? Are you unable to access the CGI for testing purposes?
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're missing ".href" for your window.location line:
Try
window.location.href
or
location.href
------------------
 
"How many licks ..." - I think all of this dog's research starts with these words. Tasty tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic