I guess instead of jsut posting some code I'll explain what I did to get this far. maybe it
will help you with future requests of the same type.
the question at hand was to convert vbscript to jscript server side.
first step was to search for syntax on the form collection in jscript.
functions known to need were .length, for loop in jscript, and if syntax.
after that you can build the function
second I wroite a client level script to perform the task to check for accuracy in javascript
here is that. (IE only)
<html>
<head>
<script language="javascript">
function runIt() {
var val = "";
var nam = "";
for(x = 0; x < iniFrm.length; x++) {
val = document.iniFrm.elements[x]
if((val.name.substr(0,1)=="C"

&&(val.checked==true)) {
newBok.innerHTML=newBok.innerHTML+"<input type='checkbox' name="+val.name+" CHECKED><br>";
} else {
if((val.name.substr(0,1)=="T"

&&(val.value.length>0)) {
newBok.innerHTML=newBok.innerHTML+"<input type='text' name="+val.name+" value="+val.value+"><br>";
}
}
}
}
</script>
</head>
<body>
<form name="iniFrm">
<input type="checkbox" name="CHECK1"><br>
<input type="checkbox" name="NOCHECK2"><br>
<input type="checkbox" name="CHECK3"><br>
<input type="text" name="TEXTBOX1"><br>
<input type="text" name="NOTEXTBOX2"><br>
<input type="text" name="TEXTBOX3"><br>
<input type="button" value="run it" onClick="runIt()">
</form>
<form id"newBok" name="newBok">
</form>
</body>
</html>
Then I just converted that function verses converting the vbscript to jscript
This is the process I like to always take when I need to perfomr things as this.
again
1) get syntax and functions needed in langauge
2) search for similar examples for logic flow
3) write a client level exmaple for ease of testing
4) convert client to server with found needed changes in search
5) test and search for needed fix to errors
6) final tests
thus I came up with the above code. again not tested and unsure but it looks valid
or at least closer then before
____________________________________________________
get the best answer to your questions by asking the best questions "General FAQ" faq333-2924