
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-17-2015 02:51 PM
Hi Community,
I need to change the label of a question in a catalog item depends of the option the user choose in a Select Box, I want to use the same field to capture the information and do not create a lot of fields to do the same function.
I created a Catalog Client Scripts and tried with g_form.setLabelOf but it is not working.
var varValue = g_form.getValue('subcategory'); |
if(varValue== '2'){
g_form.setLabelOf('specifySubCategory', 'New Value')'); |
}
Do you know any other way to make this change?
Regards,
Juan
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2015 02:45 AM
Try
jQuery("label[for='"+g_form.getElement('user').id+"']").html("YourText");
Replace user with your variablename

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2015 02:45 AM
Try
jQuery("label[for='"+g_form.getElement('user').id+"']").html("YourText");
Replace user with your variablename

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2015 01:15 PM
Thanks Kalaiarasan P it worked.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2015 12:36 AM
Kalai, I was wondering if DOM manipulation can do that?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2015 01:49 AM
It's just the same .. Instead of JavaScript, have used jQuery as it's easier to manipulate DOM.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-19-2015 02:19 AM
But if I want to revert back, is that possible in JQuery but, its not happening in JavaScript