Is it possible to run a different script for a field based on radio button choice. I have a radio button with two choices and I have three fields (field 2, field 3, field 4) that have scripts to automatically add days to the date from another field (field 1). I want these three fields to run a different script based on my radio button choice.
For example, if radio button 1 is selected field 2 runs script 1 for that field; if radio button 2 is selected then field 2 runs script 2 for that field. Same thing for fields 3 & 4. Basically if radio button 1 is selected I want field 2 to add 90 days to the date entered in field 1; if radio button 2 is selected then field 2 should add 150 days to the date entered in field 1. Fields 3 & 4 will have their respective number of days to add. I already have the scripts for fields 2 - 4 but I don’t know how to write the script to be based on the radio button choice.
var date= util.scand(“dd-mmm-yyyy”, this.getField(“Last Theater Entry Date Field”).value);
date.setDate(date.getDate()+75)
event.value=util.printd(“dd-mmm-yyyy”,date)
if (getField(“Last Theater Entry Date Field”).value==“”)event.value=“”
I just change the number of days that I want added to the “Last Theater Entry Date” for the 3 fields. I want to write a script that will automatically run and change the number of days for the fields based on which option is selected for the “Primary Work Location” radio button.