JS - Form action vs. field "action"
Posted: Mon Aug 14, 2006 1:46 pm
I'm trying to read the value of a form's action attribute. Previously, I was using the following code:
Unfortunately, one of the forms I'm working with has a field named "action," and the input object was being returned, instead of the string value for the form tag's action attribute. Once I realized what the problem was, I changed it to this:
While this fixed the problem in Firefox, IE still returns the input object. Any ideas how I can specifically grab the action attribute, or perhaps an array, one element of which is the action attribute, and the other of which is the input field?
I can't change the form itself in any way, just the JS.
Code: Select all
var sAction = oForm.action;Code: Select all
var sAction = oForm.getAttribute("action");I can't change the form itself in any way, just the JS.