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:
Expand|Select|Wrap|Line Numbers
- < body onload="javascript:runMyCode('myform1','textbox1','textbox2','checkgroup1','combo1')">
Expand|Select|Wrap|Line Numbers
- 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