Forum Moderators: open

Message Too Old, No Replies

Form Action using Ajax+Not working in IE

Form Action using Ajax+Not working in IE

         

vetrib2w

10:31 am on Feb 3, 2009 (gmt 0)

10+ Year Member



Hi ,

In short:
How to change the form action attribute value using javascript and that need to supported in IE also ?

BRIEF:

I am using ajax function to submit the form.
I am also changing the action of the form tdynamically using java script.Its is working fine in FF.But i am getting the ERROR as "object doesn't support this property or method" in IE

I found that Error is occured in this line
document.forms.FORMNAME.action = "hhtp://www.google.com"

This is used to change the action url of my form.
I have this few other options like
document.FORMNAME.action ,
document.getElementById('FORMNAME').action.value .
But nothing working in IE.
Please help me.

astupidname

2:49 pm on Feb 3, 2009 (gmt 0)

10+ Year Member



<html>
<head>
<title>astupidtitle</title>
<script type="text/javascript">
function changeAction(f,a) {
document.forms[f].action = a;
}
</script>
</head>
<body>
<form action="mypage.php" name="FORMNAME">
<p><input type="text" name="myText"><br>
<input type="submit" value="Submit">
</p></form>
<button type="button" onclick="changeAction('FORMNAME','someOtherPage.php');">Change Action</button>
</body>
</html>