You will also have to use the oFormObject.elements for setting the value of a text input field element in a form. For using that, the following is the syntax :
Code:
oFormObject.elements["element_name"].value = 'Some Value';
For more proper understanding about the setting the value of a text input field element in a form, just go through the coding :
HTML Code:
<form name="register_complaint" action="#">
Full Name: <input type="text" size="30" maxlength="60" name="name" >
Address: <input type="text" size="30" maxlength="250" name="address" >
Admission: <textarea name="admission_form" rows="45" cols="130"></textarea>
Months as member: <input type="text" size="5" maxlength="5" name="membership_period" >
<input type="button" name="increase" value="+" onclick="monthModify(this.form.elements["membership_period"], 'incr');" >
<input type="button" name="decrease" value="-" onclick="monthModify(this.form.elements["membership_period"], 'decr');" >
<input type="button" name="submit" value="Submit Complaint" onclick="showElements(this.form);" >
</form>
Bookmarks