evaluate a dropdown did user make a selection

Nat_Luw September 12, 2019

can someone please give me a hand here (this is the first time i've ever posted a question)

i have a dropdown list being set to a default value in a behavior as follows

 

FormField issuelinks = getFieldById("issuelinks-linktype")

def issuelinksValue = issuelinks.getValue()

{issuelinks.setFormValue("dependent (relies) on")}

 

and now i want to evaluate whether the user has already made a selection to override the default value 

otherwise the behavior which sets the default keeps overwriting the user's selection

 

 

thanks

 

 

 

1 answer

0 votes
Rakesh Kumar September 13, 2019

Hello Nathaniel,

You can set to initialise the value of required field to "dependent (relies) on". Then in the server side script just get the issuelinks field using below line of code

FormField issuelinks = getFieldById(getFieldChanged())

and add your validation codes subsequently.

Whenever, user will change the value of this fields, your script will validate the value dynamically and users don't even need to submit the form to get the value validated.

 

Regards,

Rakesh

Nat_Luw September 18, 2019

thank you Rakesh for your response

i discovered that my initialising script was set on the field instead of the initialize - thus every time the user was making a selection - my script was re-setting the default ---- thank you

Suggest an answer

Log in or Sign up to answer