PDA

View Full Version : Cliking check box I want to pass a variable to the next page


raisa
06-12-2003, 09:19 PM
Hello,
I'm trying to pass a variable from taforstudent_display.asp to taforstudent_change.asp page clicking on a check box, but obviously something wrong. I cannot figure it out. Please, help me!

Thank you very much!

Here is my code:

<script LANGUAGE="JavaScript">
function Delete_record() {
document.location.href="taforstu_changes.asp?strDelete_add='1'";
}
</script>

<table>
<tr><td ALIGN="CENTER"><h5><input type="checkbox" name="check_del" OnClick ="Delete_record()"></h5></td>
</tr>
</table>
Then when I check on taforstu_changes.asp value of strDelete_add :
Response.write "StrDelete_add= " & strDelete_add & "
"
it is empty.. :confused:

Terry
06-12-2003, 11:26 PM
I've moved a copy of your post to the ASP forum. Either forum would be fine as it's a combination of Javascript and ASP, but I think the ASP forum would give it a bit more exposure :)

intrader
06-19-2003, 10:37 PM
You need to make reference to the Request.QueryString object to get the value of a parameter. For example if you want to the value of a parameter foo, you would say one of two things:
Request("foo") ---- may not work in all asp versions
Request.QueryString("foo") --- allways works

In either case if you have more than one field with the name foo, or if you have more than one parameter with the name foo, you will get comma-list of values

I hope this helps;)