mlse
05-27-2009, 12:17 PM
Hi all,
Consider the following function:
function form_getvars(formobj)
{
var getvars = {};
//Process the form elements.
for (i=0; i<formobj.elements.length; i++)
getvars[formobj.elements[i].name] = element_getvalue(formobj.elements[i]);
return getvars;
}
Where formobj is the form object obtained from document.forms within which a submit button has been pressed.
So ... is there any way that formobj knows which of it's submit buttons has been pressed? Or will I need to pass the information in separately from the webpage?
EDIT: Each submit button within each form has a unique name attribute.
Consider the following function:
function form_getvars(formobj)
{
var getvars = {};
//Process the form elements.
for (i=0; i<formobj.elements.length; i++)
getvars[formobj.elements[i].name] = element_getvalue(formobj.elements[i]);
return getvars;
}
Where formobj is the form object obtained from document.forms within which a submit button has been pressed.
So ... is there any way that formobj knows which of it's submit buttons has been pressed? Or will I need to pass the information in separately from the webpage?
EDIT: Each submit button within each form has a unique name attribute.