[ad_1]
Hi! I am able to implement my forms, but it seems very inefficient currently. I am using the Dropdown for the user to select a variety of values/choices to be calculated.
Currently, I have to use switch{}/case: clauses for the choice text switch(fieldname7|r) in each field. For example:
/* Calculate using the fields that appear via the user
dropdown selection */
(function(){
var result;
switch(fieldname7|r)
{
case 'option1': result = 0.03003/fieldname14;
break;
case 'option2': result = 0.03003/fieldname36;
break;
case 'option3': result = 0.03003/fieldname39;
break;
}
return PREC(result*1000000,1);
})()rather than simply:
- Assigning values to variables based on the user dropdown choice.
- Calculate in desired fields using those variables (as opposed to having to use
switch(), case:based on the choice text/specific fields selected via the dropdown.
i.e.,:
(function(){
var result;
/* Calculate using the variables assigned values
by the dropdown user selection */
result = variable1/(pow(variable2,2)*variable3);
return PREC(result*1000000,1);
})()Is that possible? Can the dropdown also be associated with a function or code snippet to assign values to variables, etc?
Thank you! 🙂
