function populate()...{ 76// create the associative array 77 stcForm =new Object(); 78// populate the array with the form fields as the key, 79// and the value for the fields as the value 80 stcForm.Name ="Dan G. Switzer, II"; 81 stcForm.Email ="dswitzer@pengoworks.com"; 82 stcForm.EmailUpdates ="1"; 83// since no values is given, no value will be selected 84 stcForm.FavoriteActivities ="Reading,Music,Sports"; 85 86// populate the form 87 objForm.setFields(stcForm); 88}
读取上面几个fields的value
function showForm()...{ 91 // if all you want to do is display the content of the form in an alert 92 // box for debugging information, use the objForm.dump() method instead. 93 // this will do the exact same thing as this function. 94 var str = ""; 95 struct = objForm.getFields(); 96 for( key in struct ) str += key + " = " + struct[key] + " "; 97 alert(str); 98}
<SCRIPT LANGUAGE="JavaScript">... <!--// // initialize the qForm object, specify the layer(document.singleChoice) in which the form resided in wfqFormObj =new qForm("wfqForm", "document.singleChoice"); wfqFormObj._locked =true; wfqFormObj.required('field1, field2,field3'); //--> </SCRIPT>
4 似乎qForm._locked = true似乎对button类型无用
5 使用innerHTML时遇到的问题
下面的form用另一个form来代替
并且新form也有就form有的input
并且新旧form的名字都一样。
<div> <form name="wfqListForm"> <input type="text" name="a" value="a"/> <SCRIPT LANGUAGE="JavaScript">... <!--// // initialize the qForm object, specify the layer(document.singleChoice) in which the form resided in wfqListFormObj =new qForm("wfqListForm"); //--> </SCRIPT> </form> </div>
用来替换的form
<form name="wfqListForm"> <input type="text" name="a" value="a"/> <SCRIPT LANGUAGE="JavaScript">... <!--// // initialize the qForm object, specify the layer(document.singleChoice) in which the form resided in wfqListFormObj =new qForm("wfqListForm"); //--> </SCRIPT> </form>