Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HELP! function works in IE but not Netscape 1

Status
Not open for further replies.

JoliM

Programmer
Jun 25, 2001
20
US
I have an ASP page that calls a javascript function and passes a variable to the function at the same time. The variable is used to update a hidden field in the form. After the hidden field is updated, the form is submitted.

It works like a charm in IE, but Netscape does not submit the form. It gives no error either. Code is attached below.

Thanks,
JoliM

Function used:
<script language=&quot;JavaScript&quot;>
<!--
function submit2(txt2) {
testform.Action.value = txt2;
document.testform.submit();
}
-->
</script>

Link used to call function:
<a href=&quot;javascript:submit2('Next')&quot;>Next</a>

Form used:
<form action=&quot;test.asp&quot; name=&quot;testform&quot; method=post>
<INPUT type=&quot;hidden&quot; name=Action value=&quot;&quot;>
</form>
 
try this
Code:
<script language=&quot;JavaScript&quot;>
<!--
 function submit2(txt2) {
    document.testform.Action.value = txt2;
     document.testform.submit();
 }
//-->
</script>
-petey
 
JoliM,

In the future, when Netscape seems to do nothing and provides no error message, type javascript: in as your url and press enter.

Netscape will load a new window and list all errors generated by Netscape. If the window is too jammed, press the clear button, re-generate the error, then open the javascript: page again.

Could be helpful in the future.

Tip: Don't forget your // in front of your end comment tags. Like this..

//-->

TW
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top