Here is the code. patient
is the form name.
function settarget(page) {
document.getElementById('patient').action = page;
}
The exact error message from IE is:
SCRIPT438: Object doesn't support this property or method
I have also tried it referencing document.forms[0].action
- same error.
There is no duplication of the name patient
for any other tag.
This works with Chrome and Firefox, but not IE8 on XP or IE9 on Win7. Is there a security setting in IE that is blocking this action?
Here is the code. patient
is the form name.
function settarget(page) {
document.getElementById('patient').action = page;
}
The exact error message from IE is:
SCRIPT438: Object doesn't support this property or method
I have also tried it referencing document.forms[0].action
- same error.
There is no duplication of the name patient
for any other tag.
This works with Chrome and Firefox, but not IE8 on XP or IE9 on Win7. Is there a security setting in IE that is blocking this action?
Share Improve this question edited Oct 3, 2013 at 6:53 sashkello 17.9k25 gold badges83 silver badges112 bronze badges asked May 30, 2012 at 23:52 user1306955user1306955 311 silver badge5 bronze badges 1-
1
"'patient' is the form name" - I assume you mean "the form id", given that you're using
getElementById()
? Please show your html, and perhaps how you call thesettarget()
function. – nnnnnn Commented May 30, 2012 at 23:57
1 Answer
Reset to default 7DOM elements (returned by getElementById) do not have a property action
. You need to set an attribute on the element.
document.getElementById('patient').setAttribute('action',page)