Forums

This topic is locked

Newbie Question..Help

Posted 16 Nov 2002 21:18:47
1
has voted
16 Nov 2002 21:18:47 Mashkur Alam posted:
Hi,
Does anyone can help me with a short answer, please. I want to add 2 radio buttons value, easch value carried 10 points. User has got 4 choice, if they select right one, it will carry to the next page with hidden, and so on, at end, all the right answer will add together, and show the answer. Please any friends, if knows how to do it, please let me know, cause I am very week in this.
Thanks

Babu

Replies

Replied 18 Nov 2002 09:43:03
18 Nov 2002 09:43:03 Vince Baker replied:
You need to create a session variable that will carry the total along hidden to the user.

On the first page add this above the html tag

<% Session("strTotal" = ("0" %>

On each page you must receive the score from the previous page.

Hide this by sending the details with the form set to Post not Get.

On the next page add the following above the html tag:

<% Dim strPoints, strTotal
strPoints = Request.("Name_of_radio_buttons"

strTotal = Session("strTotal" + strPoints
%>

add the second script to each page and then at the end, request the session variable and display total:

<% Dim strTotal
strTotal = Session("strTotal"
%>

<% Response.write(strTotal) %>

Regards
Vince

Response.write("The best line of code you can ever use"

VBScript | ASP | HTML | SQL | Oracle | Hosting

Edited by - bakerv on 18 Nov 2002 09:44:59
Replied 18 Nov 2002 22:15:16
18 Nov 2002 22:15:16 Mashkur Alam replied:
Hi..
Vince..Thank you very much for your time, I am really glad that some one my senior cauligues gave me a way to go ahead. thanks again.
I am going to work according your suggestion. One thing just make me confuse, I have got only one page, where 4 radio buttons, and all the question and answers are in the MSACCESS database. I retrive data calling from my Ultradev (asp). And also I have got the result page. When I click next button then it goes to another question, Could you just tell me, in this case how can I add individual code.
I am not very good in English, sorry for that. If you want to know a bit more or want to see my template and database, I can send it to you.
Please let me know what you think.
Thanks again for your time.

Babu

Reply to this topic