View Full Version : [SOLVED:] Calculation using data from a dropdown list
firas
09-28-2011, 10:26 PM
Hi everyone
Is it possible to make calculations using data from a dropdown list. For example I have a "university country" dropdown list with 5 items: USA, UE, Public, Private, Other. I have also a "university score" textbox field which will calculate score using data from the dropdown list field called "university country". If user selects USA then "university score" textbox would have a score of 10, UE a score of 10, Public a score of 8, Private a score of 6 and if Private a score of 5. any suggestions please
macropod
10-05-2011, 06:53 PM
Hi firas,
Yes, that's quite easy to do.
First, kake sure your dropdown formfield has the 'calculate on exit' property set.
Then, for each variable in the dropdown formfield, insert a formula field (not a formfield) coded along the lines of:
{IF{REF Dropdown1}= "USA" 10}
{IF{REF Dropdown1}= "UE" 10}
{IF{REF Dropdown1}= "Public" 8}
{IF{REF Dropdown1}= "Private" 5}
where 'Dropdown1' is the formfield's insternal bookmark name. These formula fields can all go on the one line - I've just separated them for readability.
Note: The field brace pairs (ie '{ }') for the above examples are created via Ctrl-F9 - you can't simply type them or copy & paste them from this message.
firas
10-05-2011, 10:48 PM
Hi Paul
I was trying to follow up instructions that you wrote but unfortunately I was unable to apply all of them. My question is how to populate a text field using the data in a dropdown list. Could you attach a demo.
Thanks for your help and for your patience.
macropod
10-10-2011, 04:30 AM
Hi firas,
I have limited Internet access ATM, hence the delay in replying. See the attached demo document, which I prepared in answer to a similar question somewhere. The fields are different, but the principle is the same.
firas
10-10-2011, 04:55 AM
Hi Paul
Thank you for you reply
I downloaded the attached file but I don't see more than a dropdown list with three items. Could you check the file.
Thanks
macropod
10-10-2011, 04:57 AM
Did you choose any of the dropdown items, or unprotect the document and press Alt-F9 to examine the field coding?
firas
10-10-2011, 05:07 AM
Hi Paul
I tried all of the three items but nothing happened.
Thanks
P.S.
I will not be available till tomorrow cause of my classes
firas
10-10-2011, 05:24 AM
Hi Paul
Sorry
I inserted a text box and everything changed, i.e. when I click over the text box apple, peach etc appears
Thank you
Sorry for being so ……
now I can mark this post as solved
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.