Hi all,
Is there a way to access a forms details by sending its parameters to a
function. For example, I have a form
named "myForm" populated by a drop down box, so that <select
name="mySel">
I am trying to send the form and drop down box name to a javascript
function, eg onChange="updat e( "myForm", "mySel")
so that, within the Javascript update(formName , selName) function
I can access the forms doing something like this:
update(formName , selName)
{
selected_index = document.forms. formName.select edIndex;
selected_value = document.forms. formName.selNam e[selectedIndex];
}
so that I can access the specified value using the input arguments to
the function, rather than doing
selected_index = document.forms. myForm.selected Index;
selected_value = document.forms. myFormn.mySel[selectedIndex];
The reason for this is because I have a lot of drop box boxes that are
changed by the user.
Thanks in advance
Paul
--
Is there a way to access a forms details by sending its parameters to a
function. For example, I have a form
named "myForm" populated by a drop down box, so that <select
name="mySel">
I am trying to send the form and drop down box name to a javascript
function, eg onChange="updat e( "myForm", "mySel")
so that, within the Javascript update(formName , selName) function
I can access the forms doing something like this:
update(formName , selName)
{
selected_index = document.forms. formName.select edIndex;
selected_value = document.forms. formName.selNam e[selectedIndex];
}
so that I can access the specified value using the input arguments to
the function, rather than doing
selected_index = document.forms. myForm.selected Index;
selected_value = document.forms. myFormn.mySel[selectedIndex];
The reason for this is because I have a lot of drop box boxes that are
changed by the user.
Thanks in advance
Paul
--
Comment