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!

Replace Nan with null is JQuery script in Oracle Apex

RhodJun 27 2023

Hi

I followed Vinish Kapoors excellent validation tutorial and have the following JQuery code in the 'Execute when Page Loads' section of my page.

$(".allow-decimal").keypress(function (e) {
if(e.which == 46){
if($(this).val().indexOf('.') != -1) {
return false;
}
}

if (e.which != 8 && e.which != 0 && e.which != 46 && (e.which 57)) {
return false;
}

});

My problem is that this returns NaN (not a number) if the user enters character data, could someone please guide me in changing it to return null or zero?

Thanks,
Rhodri

Application Express 19.2.0.00.18

Comments
Post Details
Added on Jun 27 2023
0 comments
262 views