Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Getting the values of selected checkboxes

i hope i get help on this one coz i need it badly.
i have a group of related chheckboxes, when i retrive them from the form using javascript in asp i got something like an array, but i didn't find a way to store these variables into an array or even to get them one by one.(if nothing is selected there will be nothing)
here is some code:
<%//... prepare connection
courses=Request.Form("courses");
var sql3="";
for (var element in courses)
sql3=sql3 & "insert into HtsSCourses values( '"+id+", '"+courses(element)+"')
connection.open(odbc)
connection.execute(sql3)
connection.close()%>
.
.
.the thing is in eitherway i am not getting any data,
plzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz help...

Comments

  • aaronjones3593aaronjones3593 Member Posts: 122
    : i hope i get help on this one coz i need it badly.
    : i have a group of related chheckboxes, when i retrive them from the form using javascript in asp i got something like an array, but i didn't find a way to store these variables into an array or even to get them one by one.(if nothing is selected there will be nothing)
    : here is some code:
    : <%//... prepare connection
    : courses=Request.Form("courses");
    : var sql3="";
    : for (var element in courses)
    : sql3=sql3 & "insert into HtsSCourses values( '"+id+", '"+courses(element)+"')
    : connection.open(odbc)
    : connection.execute(sql3)
    : connection.close()%>
    : .
    : .
    : .the thing is in eitherway i am not getting any data,
    : plzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz help...
    :
    [url]http://www.programmersheaven.com/c/MsgBoard/read.asp?Board=22&MsgID=321119&Setting=A9999F0001[/url]
  • x_rayx_ray Member Posts: 71
    : : i hope i get help on this one coz i need it badly.
    : : i have a group of related chheckboxes, when i retrive them from the form using javascript in asp i got something like an array, but i didn't find a way to store these variables into an array or even to get them one by one.(if nothing is selected there will be nothing)
    : : here is some code:
    : : <%//... prepare connection
    : : courses=Request.Form("courses");
    : : var sql3="";
    : : for (var element in courses)
    : : sql3=sql3 & "insert into HtsSCourses values( '"+id+", '"+courses(element)+"')
    : : connection.open(odbc)
    : : connection.execute(sql3)
    : : connection.close()%>
    : : .
    : : .
    : : .the thing is in eitherway i am not getting any data,
    : : plzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz help...
    : :
    : [url]http://www.programmersheaven.com/c/MsgBoard/read.asp?Board=22&MsgID=321119&Setting=A9999F0001[/url]
    :
    10x you are my savior,although i found another way (the error in the code above was with the js array, substitue the for in with a simple for and let the .count do the rest,simple huh :), and all coz of u :)
Sign In or Register to comment.