Skip to Main Content

Highlight empty required items on APEX 4.2

Here is how to highlight form text items, witch Value Required attribute is set to "Yes" and do not have any value.

Create dynamic action to page zero

  • Name: Highlight required
  • Event: Change
  • Selection Type: jQuery Selector
  • jQuery Selector: input[type='text'][required]
  • Condition: -No Condition-
  • Action: Execute JavaScript code
  • Fire On Page Load: True
  • Code:
    if(!$v(this.triggeringElement)){
     $(this.triggeringElement).css({"background":"#FFFF77"});
    }else{
     $(this.triggeringElement).css({"background":""});
    }
    
  • Selection Type: None

Now run application and items having Value Required set to "Yes" background color is changed if item do not have any value.

You can find Value Required setting from item attributes.

If you do not like use this for all your application items, you can create dynamic action to specific page(s). Or if you do not use item Value Required setting, you can use e.g. Item as Selection Type for dynamic action and specify items you like highlight.

See working example.

Comments

  • Angus Crighton 14 Jun 2016

    Hi

    I applied this to my application, but it does not seem to work for select lists

    Gus

  • Jari Laine 31 Jul 2013

    Hi Jovaini,

    For textarea you need just change jQuery selector.

    Apply styles to checkbox or radio buttons is bit tricky. You can search e.g. from Google various ways to do that.

    Regards,
    Jari

  • Mehdi Jovaini 31 Jul 2013

    Hi

    this dynamic Action work in Datepicker , popuplov and File type

    For Example

    For File Type : input[type='file'][required]

    For Password : input[type='password'][required]

    For Lov And Datepicker : input[type='text'][required]

    Dose Not Work In Radio Button And Check Box And textarea

  • Jari Laine 23 Jul 2013

    Hi M.Jovaini,

    Most of APEX items are input tags, so solution works for date picker, and popup LOV without changes.

    Regards,
    Jari

  • Mehdi Jovaini 23 Jul 2013

    Hi Dear

    how to use Dynamic Action For all Apex Item

    For Example : textaria , Datepicker , Select List , popuplov and ...