Wednesday, September 6, 2023

Highlight empty required items

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({"border-color":"red"});
}else{
 $(this.triggeringElement).css({"border-color":""});
}


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.



No comments:

Post a Comment

To generate a PDF using JavaScript in Oracle APEX from a collection

  To generate a PDF using JavaScript in Oracle APEX from a collection, you can follow these steps: 1. Create a button or link on your APEX p...