using a javascript variable with PL/SQL procedure [message #656612] |
Wed, 12 October 2016 12:43 |
![](//www.gravatar.com/avatar/289788c5c4d2bf860284ff8a61071853?s=64&d=mm&r=g) |
metal_navin
Messages: 21 Registered: February 2013
|
Junior Member |
|
|
Good day.
Below is the javascript code I am using within my pl/sql html rendered website.
I want to use the pl/sql procedure, CWAVALIDATE.VALIDATE_ACCOUNTNUM, using the form field "document.formname.accountnbr.value" as the input value of the procedure.
So, for example, something like
CWAVALIDATE.VALIDATE_ACCOUNTNUM(document.formname.accountnbr.value). (see line 9 of the below code)
Is this possible? How can this be implemented?
Thank you
htp.p('<SCRIPT LANGUAGE="JavaScript">');
htp.p(' function ValidateForm(f)');
htp.p(' {');
htp.p(' var NullMsg = "' || UWPQUTIL.F_GET_MESSAGE_TEXT('CWA-0051', languageCode) || '";');
--htp.p(' var validAccount = '|| CWAVALIDATE.VALIDATE_ACCOUNTNUM('523443-523443') || '";');
--htp.p(' var validAccount = "'|| true || '";');
htp.p(' var j = 0;');
htp.p(' var e;');
CWAVALIDATE.VALIDATE_ACCOUNTNUM(accountnbr);
htp.p(' for (var i = 0; i < f.elements.length; i++) {');
htp.p(' e = f.elements[i];');
htp.p(' if ((');
htp.p(' (e.name == "accountnbr")');
htp.p(' ||');
htp.p(' (e.name == "userid")');
htp.p(' ||');
htp.p(' (e.name == "pinnumber")');
htp.p(' ||');
htp.p(' (e.name == "pinnumber2")');
htp.p(' ||');
htp.p(' (e.name == "ss4" && ''' || REQ_SS || '''=="Y")');
htp.p(' ||');
htp.p(' (e.name == "dl4" && ''' || REQ_DL || '''=="Y")');
htp.p(' ) && (!isNonNullWithMsg(f.elements[i],NullMsg)))');
htp.p(' {');
htp.p(' f.elements[i].focus();');
htp.p(' return false;');
htp.p(' }');
htp.p(' } ');
htp.p(' return true;');
htp.p(' }');
htp.p('</SCRIPT>')
[Updated on: Wed, 12 October 2016 13:14] Report message to a moderator
|
|
|