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!

Dynamic validation of text region item

Neel shahJun 23 2023 — edited Jun 26 2023

Hello Folks -

I have a radio button, on change of Radio button field,

Hide and Show region. and then I want to make required option based on selection made in radio item.

Here is the code im using

var P33_DB_SUBTYPE = $v('P33_DB_SUBTYPE');
var P33_DB_PG_Q1_CRYPTO = $v('P33_DB_PG_Q1_CRYPTO');
var P33_DB_PG_Q2_CRYPTO = $v('P33_DB_PG_Q2_CRYPTO');

console.clear();


if (P33_DB_SUBTYPE === 'Crypto') {
    console.log('INCRYPTO');
    console.log(P33_DB_SUBTYPE);
    console.log(P33_DB_PG_Q1_CRYPTO);
    console.log(P33_DB_PG_Q2_CRYPTO);

    $('#P33_DB_PG_Q1_CRYPTO').attr("required", "true");
    $('#P33_DB_PG_Q2_CRYPTO').attr("required", "true"); }

 else if (P33_DB_SUBTYPE != 'Crypto') 
  {  console.log('INBFI');
    console.log(P33_DB_SUBTYPE);
    console.log(P33_DB_PG_Q1_CRYPTO);
    console.log(P33_DB_PG_Q2_CRYPTO);

    $('#P33_DB_PG_Q1_CRYPTO').attr("required", "false");
    $('#P33_DB_PG_Q2_CRYPTO').attr("required", "false");
}

Item dont have value required flag on but template is selected to Required.

when I hit submit I still get a value required error then tho radio item ≠ crypto

Please advise.

Comments
Post Details
Added on Jun 23 2023
0 comments
267 views