mack
mack

Reputation: 1828

javascript form field submit : Object doesn't support this property or method in IE8

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?

Upvotes: 0

Views: 3444

Answers (3)

mack
mack

Reputation: 1828

solved the problem by replacing following line

fieldName.form.action = 'some action url';

to

fieldName.form.setAttribute('action','some url');

got answer from here

Upvotes: 1

Barmar
Barmar

Reputation: 781731

document.getElementById('IdOfForm').action='some action URL';

Upvotes: 0

Hkachhia
Hkachhia

Reputation: 4539

Try this code

document.form_name.action='some url';

Upvotes: 0

Related Questions