Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles
New Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

 
 

APEX: Managing APEX JavaScript Source Code

Oracle Tips by Burleson Consulting

Managing APEX JavaScript Source Code

Although JavaScript can be embedded almost anywhere within the HTML source code it is most commonly embedded between the <head> and </head> tags.  In HTML DB this area is identified in each application page in the HTML Header region of the Page Attributes page.

Embedding JavaScript "See JavaScript"  source code in HTML DB can be accomplished in any of 3 ways:

  • §       As In-Line source code in the HTML Header section of the page attributes for an application page.

  • §       As a Static File in Shared Components -> Static Files.

  • §       As a file in a directory on the machine hosting the HTTP Server.

By this point in the book you are familiar with creating the various objects so I won’t walk you through it.  To exercise the steps in this section you should create a new application with a region including two page items: 1) a USERNAME page item of type Text Field; 2) a PASSWORD page item of type Password (don’t use the Password (submits when Enter pressed) option).  Also create a button with the name SUBMIT in the region as Create a button in a region position.

The JavaScript we will be using in this section is shown in listing x.1 and is available in the on-line code depot so you don’t have to type it yourself.

SEE CODE DEPOT FOR FULL SCRIPTS

<script language="JavaScript1.1" type="text/javascript">
   function setFocus(PageItem) {
      document.getElementById(PageItem).focus();
   }
 
   function validateLogin() {
      if (document.getElementById('P4_USERNAME').value == "") {
        alert("Login ID must have a value provided.");
        document.getElementById('P4_USERNAME').focus();
      }
      else if (document.getElementById('P4_PASSWORD').value == "") {
        alert("Password must have a value provided.");
        document.getElementById('P4_PASSWORD').focus();
        document.getElementById('P4_PASSWORD').select();
      }
      else {
         doSubmit('SUBMIT');
      }
   }
</script>

<      Listing x.1 – JavaScript sample.

 SEE CODE DEPOT FOR FULL SCRIPTS

The code in Listing x.1 performs two functions.  One is to set the focus of the page item and the other is to validate the username and password page items are not null before the page is submitted for processing.

The button you created is going to be used to execute the validateLogin function.  If the validation is ok the function will then perform the SUBMIT for the page.

For more information on this topic, see the book "Easy Oracle HTML-DB Application Express ", the best book anywhere on expert APEX development:

APEX developer support:

For APEX development support just call to gat an Oracle Certified professional for all APEX development projects.

 

Easy Oracle HTML-DB Application Express
By Michael Cunningham & Kent Crotty

Only $27.95

Buy it now and get the code depot download

 


 

 

��  
 
 
Oracle Training at Sea
 
 
 
 
oracle dba poster
 

 
Follow us on Twitter 
 
Oracle performance tuning software 
 
Oracle Linux poster
 
 
 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright © 1996 -  2017

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.

Remote Emergency Support provided by Conversational