This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

IE and Netscape

 
Varsha Redkar
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • 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.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • Quote
  • Report post to moderator
I am not the person using the CGI.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • 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?
 
Neil M
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're missing ".href" for your window.location line:
Try
window.location.href
or
location.href
------------------
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic