Title: RE: IsDefined/ParameterExists
I was totaling all questions... but you can total the Yeses, Nos and N/As with a condition.
 
Set a "TotalYes", "TotalNo" and "TotalNA".  Then go through each button and :
 
if question_1 EQ 2 then TotalYes=TotalYes+1
elseif question_1 EQ 1 then TotalNo=TotalNo+1
else TotalNA = TotalNA+1
 
Again, if you know the number of questions a loop might not be a bad idea.
 
Hatton
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Houk, Gary
Sent: Tuesday, April 03, 2001 11:48 AM
To: '[EMAIL PROTECTED]'
Subject: RE: Calculating Radio Buttons

Hatton,
 
Forgive me if I'm missing something very basic here! If I have the code:
 
Question 1 is?
Yes<input type="radio" name="question_1" value="2">
No <input type="radio" name="question_1" value="1">
N/A<input type="radio" name="question_1" value="0">
 
Question 2 is?
Yes<input type="radio" name="question_2" value="2">
No <input type="radio" name="question_2" value="1">
N/A<input type="radio" name="question_2" value="0">
 
I don't understand how to individually total the number of questions that were answered Yes, No, and N/A, ending up with a score for each. I need to total each answer type. Could you please turn on the light :-)
 
- Gary

 
 
 -----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 03, 2001 10:02 AM
To: [EMAIL PROTECTED]
Subject: RE: Calculating Radio Buttons

Oh, that makes *much* more sense. (*grin*)
 
Set your radio buttons to contain the desired values (Y=2, N=1, N/A=0).  Then on your action page simply set Total=R1+R2... etc.
 
If you did not know how many questions there might be, on the form page set a counter up and have input "type=radio name=Radio#counter#" and then loop through the number of items on the action page, gathering the value with an Evaluate("Radio#counter#").
 
HTH
Hatton
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Houk, Gary
Sent: Tuesday, April 03, 2001 9:52 AM
To: '[EMAIL PROTECTED]'
Subject: RE: Calculating Radio Buttons

The form fields Y,N,NA need to be totaled on a form basis. A score needs to be totaled for each time that a user fills out the form. I was initially thinking javascript and the onchange event but wanted to see if anyone had any other suggestions on a way to tackle this...
 
To be clearer, taking this:
 
1.    Y    N    N/A
2.    Y    N    N/A
3.    Y    N    N/A
A score could be generated as follows:
 
Total of questions answered: 3
 
Y=2
N=1
 
or
 
Total of questions answered: 3
 
Y=1
N=1
N/A=1
 
Maybe that will help to clear up my question :-)
 
- Gary
 
 
 -----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 03, 2001 9:29 AM
To: [EMAIL PROTECTED]
Subject: RE: Calculating Radio Buttons

I'm not sure I follow your question.  You want to count the number of changes for each fieldname? So if you have a form that has:
 
1.    Y    N    N/A
2.    Y    N    N/A
3.    Y    N    N/A
 
Am I understanding that you want to count how many times the selection in #1 was changed (eg. if I selected Y then N then Y then N/A, the count would be 4) and so on for each question?  Or are you wanting to count the number of times the form is resubmitted?
 
If it's counting the number of times each form field is changed, that's going to take something client-side, as CF "lets go" of the page once it's been sent to the browser.  You could use JavaScript to check an onChange and increment an internal counter than could be sent back to a CF Variable and passed to the action page.
 
If it's the latter then you could set a hidden field that holds the number of times a user has accessed the form (needs to be a database column) and then on the action page, update the table with "Number of changes + 1" (assuming that the first time the form is filled out you set the value to 1, 2 would be set on the first change, etc.)
 
Hatton
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Houk, Gary
Sent: Tuesday, April 03, 2001 8:45 AM
To: '[EMAIL PROTECTED]'
Subject: Calculating Radio Buttons

Hi all,
 
I'm looking for someone to just help to point me in the right direction on this. We have a form with 10 questions, each one being able to be answered either YES, NO, N/A    I need to have the form count how many times each one was checked. It can do this either on the form in realtime or on an action page. I have each question's answers set up with radio buttons, but I'm not sure on the best way to count how many times each one was checked.
 
Thanks in advance,
 
- Gary

Reply via email to