<ptml> <pead> <title>js Cumulative 001-rows and cells use </title> <scrip T type= "Text/javascript" > Function ValidForm (curform, bodyname) {var bodyobj = do Cument.getelementbyid (Bodyname); var rowobj = null; var cellobj = null; if (bodyobj = = null) {return false; //reference rows for (var i = 0; i < bodyObj.rows.length i + +) {rowobj = bodyobj.rows[i]; with * must input, reference cells if (Rowobj.cells[0].innertext.indexof ("*") > 0) { if (Rowobj.cells[1].childnodes[0].value = = "") {alert (Rowobj.cells[0].innertext.replac E ("*:", "") + "cannot be empty!" "); return false; } alert ("Pass Validation"); Curform.submit (); } </script> </pead> <body> <form action= "method=" post "Name=" Loginf RM "> <table> <tbody id=" Validbody "> <tr> <t D align= "right" > Username <font color= "Red" >*</font>:</td> <td><input type= "text" n Ame= "username"/></td> </tr> <tr> <td align= "right" > Secret Code <font color= "Red" >*</font>:</td> <td><input type= "password" name= "username"/& gt;</td> </tr> <tr> <td align= "right" > Subsystem <font Color = "Red" >*</font>: </td> <td> <select name= "SystemName" > <option value= "" >---Please select ---</option> <option value= "hr" > HR system </option> <option value= "PUR" > Procurement System </option> <option value= "SAL" > Sales system </option> </select> </td> </tr> </tbody> <tbody> <tr> ; <TD colspan= "2" > <input type= "button" value= "submitted" name= "Submit" onclick= "ValidForm (this. form, ' validbody ') "/> <input type=" reset "value=" reset "name=" reset "/> </td> </tr> </tbody> </table> </for M> </body> </ptml>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]