问题
i'm getting following error in IE8
Object doesn't support this property or method
i'm getting this error on following line
fieldName.form.action = 'some action url';
i have alerted fieldName like following
alert(typeof(fieldName));
it alerts 'Object'
anyone have any idea about this?
回答1:
solved the problem by replacing following line
fieldName.form.action = 'some action url';
to
fieldName.form.setAttribute('action','some url');
got answer from here
回答2:
Try this code
document.form_name.action='some url';
回答3:
document.getElementById('IdOfForm').action='some action URL';
来源:https://stackoverflow.com/questions/12243428/javascript-form-field-submit-object-doesnt-support-this-property-or-method-in