Please help with Client Script to hide a text box.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2023 12:37 PM
Hello,
I have the following 2 variables on a Catalog Item.
- Single Row Variable Set
- Single Line Text Variable
I need help on Client Script if Single Row Variable is empty, hide the Employee ID Text Box else don't hide it.
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2023 07:10 PM
Hello @Prince Arora
Could you please try the following steps in your PDI to see if it works? I could not get it works.
1. Create a Single Row Variable Set
2. Create "Request for" type variable in side of Single Row Variable Set
3. Under "Type Specifications" Tab, Select "Enable also request for" check box
4. Create a Single Line Text Variable
5. Use UI policy and see if you can hide the "Also request for" field.
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-08-2023 10:26 PM
use client script
via requestedfor = g_form.getValue("requested_for")
if(requestedfor == ' '|| requestedfor == ){
g_form.setVisible('emp iD back end value' false);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-09-2023 09:57 AM
Suggestion script is not working. "requested_for" is not the internal name for "Also request for"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2023 07:45 PM
go to the catalog item and go down and variable will present. open the " Also request for" variable open copy the back end value and replace with requested for name to Also request for
Example back end value:
on change client script: on variable "Also request for"
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2023 09:02 PM
what is your reasoning for scripting this? this can easily be done in a UI Policy as multiple people on this thread have stated.