Client Script - Hide Variables
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2015 10:47 AM
I have no idea why this script isn't working, it seems to be working in every other client script I have going.
This is my client script that on submit, if the number in quantity is quoted, clear the vendor as well as hide the rest of the variables on the submitted request or if not, clear the first quantity quoted. when I submit the request with u_quantity_quoted_2 blank, the vendor clears out but the rest of the variable are visible. what am I missing? does it matter that this was a custom table?
function onSubmit() {
//Type appropriate comment here, and begin script below
var quote = parseInt(g_form.getValue('u_quantity_quoted_2'));
// if quote < 0, hide quantity left, model, price, and quantity order
if(quote < 0){
g_form.clearValue('u_vendor');
g_form.setDisplay('u_quantity_left_2',false);
g_form.setDisplay('u_model_2',false);
g_form.setDisplay('u_price_2',false);
g_form.setDisplay('u_quantity_order_2',false);
} else {
g_form.clearValue('u_quantity_quoted');
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2015 10:56 AM
Hi Alex,
Can you reproduce this issue on any demo instance so that I can take a look and help you out.
Also just make sure that you don't have any existing UI policy/client script which might be conflicting with your current script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2015 11:51 AM
just sent you a message

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2015 12:01 PM
You mean the script is not working when the quantity quoted value is blank or less than zero. Please tell me the steps to replicate.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2015 12:18 PM
This is a long and probably over complicated process. So what I want this script to ultimately do is if there is nothing put in for u_quantity_quote_2 then hide that field and all the rest of the ones below it.
I really only have clearValue on u_vendor and u_quantity_quoted to see if any of the script was working, so those parts will eventually be taken out entirely.
so the 'hide variables not quoted for' is the client script having issues. the way it is set up now is if you enter anything in the u_quantity_quote_2 field and hit submit, the variables below it should remain unhidden and u_quantity_quoted should clear.
otherwise, if you don't put anything in u_quantity_quoted_2 the variable underneath it should hide and u_vendor should clear