You are viewing limited content. For full access, please sign in.

Question

Question

Modern Form designer javascript "Other" radio button

asked on January 29

Successfully using a lookup rule to populate a field and using javascript to set a radio button according to that field.  However, I can't get it to assign to the "other" option in the list.  When inspecting the HTML it is labelled "Other" and am using the exact same js to assign it, but it cannot seem to target the Other option.

 

Anyone ran into this?  This is using self-hosted Forms 11

0 0

Answer

SELECTED ANSWER
replied on January 30

Let me know if this code from the documentation doesn't work! 

https://doc.laserfiche.com/laserfiche.documentation/en-us/Default.htm#../Subsystems/ProcessAutomation/Content/Forms-Current/Javascript-and-CSS/TheLFFormObject.htm#setFieldValues

 

// Radio button fields expect an object with a "value" property. 
// For example: {value: "Choice 2"}, {value: "_other", otherChoiceValue: "Hi"}

LFForm.setFieldValues({fieldId: 10}, {value: "_other", otherChoiceValue: "Hi"});
1 0
replied on February 3

Amazing... thanks.  In my next life I'll learn to pay closer attention to manufacturer documentation ;)

0 0

Replies

replied on January 29

For context, here's the line that works fine when I put any label on it for the options, but can't seem to get it to select "Other".  Have tried _other as well, I stumbled upon that reference somewhere in the depths of the internet.

 

{LFForm.setFieldValues({fieldId:24}, {value: "Other"});}    

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.