Custom JS [ Show Hide Fields ]
- This topic has 2 replies, 2 voices, and was last updated 11 years, 1 month ago by .
Viewing 2 reply threads
Viewing 2 reply threads
- You must be logged in to reply to this topic.
Home › Forums › Classic DFFS › Custom JS [ Show Hide Fields ]
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:-
spjs.dffs.flag_Mandatory
spjs.dffs.clear_Mandatory
to toggle Mandatory on off. Is there something similar for Show/ Hide?
You can use a “normal” jQuery selector like this:
// hide
$("#dffs_FieldInternalName").hide();
// show
$("#dffs_FieldInternalName").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.
Alexander
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.