Changing a forms Action value using Javascript in Netscape

Hi I have a form with some buttons and on the onClick() for the buttons I run a javascript function which changes the "ACTION = " for the form. This works fine in IE5+,i.e I can change the value and the form redirects correctly to. However in Netscape 4 and Netscape 6. It does not set correctly and the form always redirects to the original " ACTION= " web page .

Does anyone know of a way to correctly get this to work on Netscape, or have any pointers, comments, suggestions etc.

Thanks in advance

LK--<
LizardKingAsked:
Who is Participating?
 
nimaigConnect With a Mentor Commented:
This works well in Netscape 4.7

<HTML>
<HEAD>
<TITLE>test</TITLE>
<script language="javascript">
<!--
     function changeAction(formObj){
          formObj.action = "test3.html";    
          formObj.submit();
     }
//-->
</script>
</HEAD>
<BODY>
<form name="form1" action="test2.html">
     <input type="button" value="Click" onClick="changeAction(this.form)">
</form>
</BODY>
</HTML>
0
 
LizardKingAuthor Commented:
nimaig

You are right that does work great in Netscape 4.7 , However it does not work in Netscape 6... Any Ideas on how to get it to work in that

Thanks Again

LK--<

0
 
LizardKingAuthor Commented:
Actually

I took out the code which checks the browser and left in just the formObj.action = "" and it seems to work fine
on all 3 browsers

Thanks a million

LK--<
0
 
LizardKingAuthor Commented:
Actually

I took out the code which checks the browser and left in just the formObj.action = "" and it seems to work fine
on all 3 browsers

Thanks a million

LK--<
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.