Using the Field object to Manipulate table fields (Api:http://www.prototypejs.org/api/form)
Sample code:
<script src= "Prototype-1.6.0.2.js" type= "Text/javascript" ></script>
<body>
<input id= "Text1" type= "text"/><br>
<input id= "Text2" type= "text"/><br>
<input id= "Text3" type= "text"/><br>
<input id= "Text4" type= "text" value= "xxxxxxxxx"/><br>
<select size= "3" id= "St1" >
<option>Java</option>
<option>Struts</option>
<option>Spring</option>
</select>
<br>
<input type= "button" value= "AA" onclick= "field.clear (' Text1 ', ' text2 ', ' Text3 ')"/><br>
<input type= "button" value= "BB" onclick= "Alert (field.present (' Text1 ', ' text2 ', ' Text3 ')") "/><br>
<input type= "button" value= "CC" onclick= "Field.focus (' Text3 ')"/><br>
<input type= "button" value= "dd" onclick= "Field.select (' Text4 ')"/><br>
<input type= "button" value= "ee" onclick= "field.activate (' St1 ')"/><br>
</body>
<script>
</script>
Function Description:
1.clear: Clears all form field values passed into this method.
2.present: Determines whether all form fields have a value.
3.focus: Specifies the focus.
4.select: Select the text within the form field (text box only, text is valid).
5.activate: With Select and one more feature: if the target element is not selected, the focus moves to the target element.
In addition, you can use the Form.element object with the sample code as follows:
<script src="prototype-1.6.0.2.js" type="text/javascript"></script>
<body>
<input id="text1" name="text1" type="text" /><br>
<input type="button" value="aaa" onClick="alert (Form.Element.serialize('text1'));"/><br>
<input type="button" value="bbb" onClick="alert (Form.Element.getValue('text1'));"/><br>
</body>