Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
12 replies
Subscribers
8 subscribers
Views
4495 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
Hi. We would like to use jQuery function. I read from somewhere in the forum tha
Will Teoh
over 10 years ago
Hi. We would like to use jQuery function. I read from somewhere in the forum that Appian shipped with jQuery. Can I know what version of jQuery Appian 7.3 is using?
Can we directly use jQuery functions in the form without even importing it? Or we have to import it?...
OriginalPostID-99823
OriginalPostID-99823
Discussion posts and replies are publicly visible
0
Eduardo Fuentes
Appian Employee
over 10 years ago
1. Take a look at
forum.appian.com/.../e-79999
2. Functions from that version can be used without anything additional
3. Remember that the use of JS is not recommended since that won't be Tempo/Mobile compatible
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Will Teoh
over 10 years ago
I tried using jQuery as per below in the on change event rules:
if($("#status option:selected" ).text()=="No Go"){
$('#closedReason').show();
} else {
$('#closedReason').hide();
}
It is to hide and display an input field based on the dropdown. But I can't get it to work. Something wrong with my code? I did not import anything.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eduardo Fuentes
Appian Employee
over 10 years ago
You have to use IE Developer Tools or Firebug to inspect the form to identify how IDs of these components are assigned in the DOM. Appian doesn't assign the ID you put in the forms designer as-is to the element in the DOM.
You can also use the Advanced Form Utilities and its getControl() JavaScript function that will do that for you.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eduardo Fuentes
Appian Employee
over 10 years ago
But why are you using JQuery for this requirement? Appian already has the getValue().id and show() and hide() functions out of the box (e.g. window.FormAPI.show())
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eduardo Fuentes
Appian Employee
over 10 years ago
forum.appian.com/.../FormAPI
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Will Teoh
over 10 years ago
Just trying out jQuery Eduardo. Thanks
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eduardo Fuentes
Appian Employee
over 10 years ago
If you still want to test with JQuery you have to identify the real ID in the DOM inspecting it using Firebug or IE Developer Tools or using the getControl() component in the Advanced Form Utilities.
These is how the IDs are formed for the text and dropdown fields:
$('#textControl_fd_component_' + window.FormDesigner.runtimeNamespace + fieldId)
$('#dropdownControl_fd_component_' + window.FormDesigner.runtimeNamespace + fieldId)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Will Teoh
over 10 years ago
another question eduardo, if i have defaulted the field to hide, and i wanna show the field if i have selected a certain value in the drop down, it can't be done? i have tried and it seems it won't work that way. if the field is default to show, then the javascript can work?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Eduardo Fuentes
Appian Employee
over 10 years ago
For JavaScript show/hide to work the field needs to be hidden on the load event of the form rather than at design time, this guarantees the component is still in the DOM but hidden while hiding at design time doesn't render it at all.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Will Teoh
over 10 years ago
I see... Got it! last question... any ways to check if the field is hidden or show? like a isHide function?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
>