Hi
I am using an external JavaScript file that should handle number of similar forms and form elements on different html pages.
What I need to do is , pass the name of the form, the two text boxes , name of a combobox and a checkbox group to the file.
As an example , inside Webpage I have:
and the external file has the following code:
But it is wrong and I am hoping JavaScript experts will help me solve this. Kindly tell me how to go about this.
Thank you in advance
Evrim
I am using an external JavaScript file that should handle number of similar forms and form elements on different html pages.
What I need to do is , pass the name of the form, the two text boxes , name of a combobox and a checkbox group to the file.
As an example , inside Webpage I have:
Code:
< body onload="javascript:runMyCode('myform1','textbox1','textbox2','checkgroup1','combo1')">
Code:
function runMyCode(form,name,job,check,cbo)
{
document.getElementById(form).getElementById(name).value='value1';
document.getElementById(form).getElementById(job).value='value2';
.....
}
But it is wrong and I am hoping JavaScript experts will help me solve this. Kindly tell me how to go about this.
Thank you in advance
Evrim
Comment