- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-08-2021 02:31 PM
I have a variable on Order guide which is multiple choice which has 4 radio buttons, I want to make 3 of them read only and select one by default
I tried Onload cS but it seems not working , can some one help me with the scrip
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-09-2021 04:48 AM
OK, so I don't know if you need me to tell you this, but when you remove the Default Value the first choice will be the default value, so if that's what you want, all you need is the UI Policy. If you want a different choice there are a few options - you can see which you prefer, or works with whatever else you have going on in this OG.
1) In your Catalog UI Policy on the Order Guide (not variable set) that is making the variable Read only, on the Script tab, check the Run scripts box, then this is the Execute if true script.
function onCondition() {
g_form.setValue('test', 2);
}
2) If you already have an onLoad Catalog Client Script on the Order Guide, you can add the setValue line to that instead of in the UI Policy, and you can add a g_form.setReadOnly to the client script, and not need the UI Policy at all.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-08-2021 03:05 PM
The best way to accomplish this is to create a Catalog UI Policy on the Order Guide to set the multiple choice variable to read only.
Then, in the variable definition on the Default Value tab, enter the Value of the choice that you would like to be selected.
Voila!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-08-2021 03:21 PM
that variable is used in 40 other Cat items , can we set the value using client script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-08-2021 03:41 PM
Sure, but isn't this on an Order Guide - or did you add it to the OG in a variable set? The onLoad Catalog Client Script should still be able to set the value even with the UI Policy making it read only. If it can't get rid of the UI Policy then the onLoad Catalog Client Script will set the value then make it RO.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-08-2021 05:34 PM
Thanks Brad,
Sorry for the confusion. I am talking about setting the value. Yes that variable is on the variable set and VS is used in the Order guide