Thursday, January 10, 2013

Disable Peoplesoft radio button using javascript

In my recent development, I need to disable one of three radio buttons based on a condition. The dilemma here is that a radio button is using the same field, so using field property displayonly = True or enabled = False won't work in this sense.

 How do I do this:

To something like this (note: catch up below is grayed out):

Here is a step by step work around to disable one radio button using a simple javascript.
  1. We need to set a page field name from the radio button properties.  I named this one "ADJ_CATCHUP".

  2. Place HTML area to the bottom of the page to make sure that the page had been fully rendered before the javascript being called)

  3. Assign Record and Field into the HTML area properties

  4. Create a new HTML definition
    Note: (I use bind variable so I can reuse this HTML code with a different field name or property(true/false)

  5. Place the peoplecode below where you need it.  In my case, I put it in the page activate.
    If &_has_paid_amounts  is True, then it will disable catch up radio button.  Otherwise, enable it.

  6. That should be it.

No comments:

Post a Comment