[TvR] -=CyRuS=-
11-01-2001, 14:58
Hi all,
I am setting up a page using MS active server pages to view and query details in a database. ( for fun of course :) for uni really)
This consists of two pages, first a html form with checkboxes to allow multiple options to be checked and posted to the asp page to decide upon which sql statement to use to display the records. ( i have four options, with a possible 15 statements being the individual checkboxes and all combinations. )
The problem being, the way i am interpretating and receiving the data from the form,
Ie for a single value, ie a text box, i store the value in a var in the asp page for use in the sql statement.
but how do i use this multiple value that i receive..
The value is in the format if i use a mailto link
age=1&cash=1&delivery=1&points=1
for all four checkboxes and like
cash=1&delivery=1&points=1
delivery=1&points=1
etc.
So i could just use a big if statement in the form of (store the value in a variable within the asp results page say vartext and use an if statement to choose the sql statement (say sqlchoiceX for pseudo code variables holding sql statements) to be used in the query?
ie.
if vartext = "age=1&cash=1&delivery=1&points=1"
THEN sqlstatement = sqlchoice1
else
if vartext = "age=1&cash=1&delivery=1"
THEN sqlstatement = sqlchoice2
else
etc..... for all 15 options or is there way for me to do this????????? and send the info for all four checkboxes to the asp page (i know how to receive for single form entites using Request.Form in the asp)
It would be possible for me to receive all four check box values to independant variables and concanate the results for comparison but the scope for errors seems enormous. :bigcry: imagine null values etc.... :{
I am sure the ever helpful Microsoft :cheese: have provided us with a better way to acheive this... its just i dont know what it is. (only started ASP week or so ago)
Thx for replies in advance...
Marcus aka [TvR]-=CyRuS=- (TVR Half-Life DM clan) :pimp:
icq = 74712177 email = marcus.j.miller@talk21.com
I am setting up a page using MS active server pages to view and query details in a database. ( for fun of course :) for uni really)
This consists of two pages, first a html form with checkboxes to allow multiple options to be checked and posted to the asp page to decide upon which sql statement to use to display the records. ( i have four options, with a possible 15 statements being the individual checkboxes and all combinations. )
The problem being, the way i am interpretating and receiving the data from the form,
Ie for a single value, ie a text box, i store the value in a var in the asp page for use in the sql statement.
but how do i use this multiple value that i receive..
The value is in the format if i use a mailto link
age=1&cash=1&delivery=1&points=1
for all four checkboxes and like
cash=1&delivery=1&points=1
delivery=1&points=1
etc.
So i could just use a big if statement in the form of (store the value in a variable within the asp results page say vartext and use an if statement to choose the sql statement (say sqlchoiceX for pseudo code variables holding sql statements) to be used in the query?
ie.
if vartext = "age=1&cash=1&delivery=1&points=1"
THEN sqlstatement = sqlchoice1
else
if vartext = "age=1&cash=1&delivery=1"
THEN sqlstatement = sqlchoice2
else
etc..... for all 15 options or is there way for me to do this????????? and send the info for all four checkboxes to the asp page (i know how to receive for single form entites using Request.Form in the asp)
It would be possible for me to receive all four check box values to independant variables and concanate the results for comparison but the scope for errors seems enormous. :bigcry: imagine null values etc.... :{
I am sure the ever helpful Microsoft :cheese: have provided us with a better way to acheive this... its just i dont know what it is. (only started ASP week or so ago)
Thx for replies in advance...
Marcus aka [TvR]-=CyRuS=- (TVR Half-Life DM clan) :pimp:
icq = 74712177 email = marcus.j.miller@talk21.com