<script language="JavaScript" src="/include/jquery-latest.pack.js"></script> <script language=JavaScript> var tmp=""; function formatn(n){ if (n<10) return "0"+n; else return ""+n; } $(document).ready(function() { var f=document.form1.elements; var n_i=1; var s_i=""; var n_v=1; for(var i=0;i<f.length;i++){ //tmp+=f[i].value+"\n"; if (f[i].type=="hidden"||f[i].name=="reg_no" ){ continue; } if (f[i].type=="text"||f[i].type=="textarea"){ f[i].name=f[i].id="text_"+formatn(n_i); n_i++; continue; } if (f[i].type=="radio"||f[i].type=="checkbox"){ var oname=f[i].name; f[i].name=f[i].id="check_"+formatn(n_i); f[i].value=formatn(n_v); if (i<f.length){ if (oname!=f[i+1].name||f[i].type!=f[i+1].type){ n_i++; n_v=1; } else n_v++; } continue; } } }); </script>