View Full Version : Need a function to disable a widget on a form/screen

10-17-2014, 06:30 PM
I haven't any real javascript experience, but I need to create a function that will disable an element on a screen based on the value of another element on the screen. Here are the specifics:

Screen ID (or Document name) : A%CCD107B2
ID of the widget to be disabled/enabled : OrderEntryUpload1
ID of the element to be checked : D_1_77

Here's what I'd like to accomplish:

if screen is A%CCD107B2
if value of D_1_77 is equal to 'I'
enable OrderEntryUpload1
disable OrderEntryUpload1

Can somebody help me out? I'm sure this is javascript 101 but I need this before I can become competent in js. I'll continue to research this on my own, but any assistance wil be appreciated.

Thanx in advance.

10-18-2014, 08:40 AM
There isn't really enough info for anyone to offer help with. For example, what are the elements? Which ones require user interaction and in what way? Are they all form fields and what types? Are you wanting to validate entered values on form submit or "live" (onkeyup? onmouseout?). Or maybe the element to check being loaded dynamically? Are you just wanting to check for its presence in the page before acting upon it with pre-populated form values elsewhere?

There is a lot to ascertain before we can give constructive help.

If you'd like specific help, please provide an URL to your page and describe in more detail how you want the process to work and elements/fields to behave.

Offering a suggestion in the unknown, my initial thought would be to Google something like "disable form field based on value of another form field".