PDA

View Full Version : Radio Buttons and variables



jcunning
03-27-2002, 02:04 PM
Hello,

I am very new to demoshield and have been given my first assignment. I was wondering if some of you experts could direct me on the best way to get started.

I am going to prepare a checklist for our students in their attempts to receive an AA degree.

So for communications, they must take 3 classes, totallying 9 credits:

I'll have several radio buttons they can choose from, but here is an example of one.

radio button for ENG 101. If they click on that, then a label box calulates the number 3 (for credits).

Then I need a subtotal label box to determine how many credits they have taken in Communications to determine whether they met the requirements.

I will have several different categories like this communications, such has humanities, etc. Each category will have a subtotal.

Then at the very end....I need a grandtotal of 64 credits (or whatever they have selected) to calulate.

Is this possible in Demoshield...or should I go to a javascript?

Thank you in advance!!

Shawna
03-27-2002, 03:31 PM
Yes, this can be done in DemoShield. I have set up a sample demo for you to look at because it is fairly involved.

Here's a summary of what I have done:

I created 2 sections, Section 1 and Section 2.

Section 1 has Classes 1 - 4.
Section 2 had Classes 5 - 8.

Each Section lists the class and credit hours next to a checkbox.
Each Section also has a subtotal button and a reset button.

The total section to the right totals up the credits for Sections 1 and 2.

When the users clicks the subtotal button for Section 1, I trigger a series of event objects. The first event object checks the pressed property of Class 1. If it is checked, I add 3 to Global Variable 1 and trigger the event object to check Class 2. If Class 1 is not checked, I just trigger the event object to check Class 2. The next event object checks the pressed property of Class 2, executing the same way as the first event object, etc.

The last event object checks the pressed property of Class 4. If checked, it adds 4 to Global Variable 1 and then displays the value of Global Variable 1 in the edit field next to the subtotal button. If not checked, then I only display Global Variable 1 in the edit field.

The subtotal button for Section 2 is set up the same way to check Classes 5 through 8 using Global Variable 2 to track the total.

The total buttons adds Global Variable 1 and 2 and stores this in Global Variable 3. This value is then displayed in the Total edit field.

Note: This can only be done in DemoShield 7.0 because you are not able to add two global variable in earlier versions, therefore I would not be able to add the total of sections 1 and 2 in versions prior to 7.0

I hope that this sample helps to get you started.

jcunning
03-27-2002, 03:43 PM
Shawna, Did you just create that or was it done prior?

It sound a bit complicated and I am new to Demoshield.

I have created something similar in Javascript and HTML and may go that route. However, i can't get my grand total to work.

However, I have opened this up and will play with it.

Thank you so much!!!