Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

APEX DA validation using javascript

Irha10May 1 2015 — edited May 5 2015

Hi,

Using APEX 4.2 (Oracle, 10 anf 11g)

I have a page and want to validate the items when click SUBMIT button using Javascript.

eg.  I have a page 10. P10_item1, P10_item2, P10_item3 so on. button name is  SUBMIT .

Dynamic action: When click -> Button -> action -> execute Javascript code

if ($x('P10_item1').value == '' || $x('P10_item2').value == '' || $x('P10_item3').value == '') {

    alert('Mandatory fields can be left blank');

  }

  else {

       apex.submit('SUBMIT');

   }

  

   ALL WORK fine above, however I want to add background-color change (field) if any above field is blank after

   click submit. I have added these onto the page CSS

  

   .highlight-error

   {

     background-color: #FAE7E7 !important;

     color: white;

   }

so how can I use this css in my javascript code after alert message please?

Many thanks.

Regards,

RI

This post has been answered by Jitendra on May 1 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 2 2015
Added on May 1 2015
9 comments
841 views