Hide "other text" box from other option in constant sum table | XM Community
Skip to main content
Solved

Hide "other text" box from other option in constant sum table

  • May 14, 2025
  • 1 reply
  • 19 views

jamesbyrne
Level 1 ●
Forum|alt.badge.img+1

I have a constant sum table where the last option is an “Other” option with an other text option.

 

How can I hide this when then input value for the “other” option is 0 or empty, and also force a response when other is greater than 0? Is this even possible? 

 

I can manage to hide it by default when opening the page with getElementById, but I’ve no idea how to then show it once a value for other is provided and also hide it again if the other value is removed.

 

Thanks!

Best answer by TomG

You can use custom validation to make sure the the text box isn’t empty if the value > 0 or empty if the value = 0.

For hiding/unhiding the text box, add a JS function to hide/unhide based the value of the input. Call the function from addOnload and from an input event handler on the the ‘other’ value field.

1 reply

TomG
Level 8 ●●●●●●●●
Forum|alt.badge.img+27
  • Level 8 ●●●●●●●●
  • 6084 replies
  • Answer
  • May 15, 2025

You can use custom validation to make sure the the text box isn’t empty if the value > 0 or empty if the value = 0.

For hiding/unhiding the text box, add a JS function to hide/unhide based the value of the input. Call the function from addOnload and from an input event handler on the the ‘other’ value field.