Custom JS [ Show Hide Fields ]

Forums Classic DFFS Custom JS [ Show Hide Fields ]

Viewing 2 reply threads
  • Author
    • #8513
      Drew Heggie

      I’m writing some Custom JS to Show/ Hide some fields on the form based on the iput values from another field. Although this can typically be done via the Rules tab the situation I am dealing with is quite complex so requires some JS. What is the syntax for Show/ Hide?

      i.e. we have:-
      to toggle Mandatory on off. Is there something similar for Show/ Hide?

    • #8526
      Alexander Bautz

      You can use a “normal” jQuery selector like this:

      // hide
      // show

      Change “FieldInternalName” for your fields name.

      There are “internal” functions to do this also, but these are linked together with tabs and rules, and this basic approach might be better.

      Let me know how it works out.


    • #8540
      Drew Heggie

      Perfect. Thanks again 😎
      While I’m here: Do you have a list of available commands that can be executed via Custom JS? E.g.
      Set field value to…
      Set Field to Read Only
      Alert message…
      Basically the commands available through the Rules Tab.

Viewing 2 reply threads
  • You must be logged in to reply to this topic.