Edit D:\app\Administrator\product\11.2.0\dbhome_1\apex\images\doc\bldapp_js_items.htm
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=us-ascii" /> <meta http-equiv="Content-Style-Type" content="text/css" /> <meta http-equiv="Content-Script-Type" content="text/javascript" /> <title>Referencing Items Using JavaScript</title> <meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1" /> <meta name="date" content="2009-04-14T16:11:29Z" /> <meta name="robots" content="noarchive" /> <meta name="doctitle" content="Referencing Items Using JavaScript" /> <meta name="relnum" content="Release 3.2" /> <meta name="partnum" content="E11947-01" /> <link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" /> <link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" /> <link rel="contents" href="toc.htm" title="Contents" type="text/html" /> <link rel="up" href="preface.htm" title="Home" type="text/html" /> <link rel="up" href="app_comp.htm" title="Adding Application Components" type="text/html" /> <link rel="up" href="bldapp_js.htm" title="Incorporating JavaScript in..." type="text/html" /> <link rel="up" href="bldapp_js_items.htm" title="Referencing Items Using Jav..." type="text/html" /> <link rel="prev" href="bldapp_js.htm" title="Previous" type="text/html" /> <link rel="next" href="bldapp_js_functions.htm" title="Next" type="text/html" /> </head> <body> <p id="BREADCRUMBING"><a href="preface.htm" title="Home">Home</a> > <a href="app_comp.htm" title="Adding Application Components">Adding Application Components</a> > <a href="bldapp_js.htm" title="Incorporating JavaScript in...">Incorporating JavaScript in...</a> > Referencing Items Using Jav...</p> <table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%"> <col width="86%" /> <col width="*" /> <tr valign="bottom"> <td align="left"></td> <td align="center"><a href="bldapp_js.htm"><img src="dcommon/gifs/leftnav.gif" alt="Previous" /><br /> <span class="icon">Previous</span></a> </td> <td align="center"><a href="bldapp_js_functions.htm"><img src="dcommon/gifs/rightnav.gif" alt="Next" /><br /> <span class="icon">Next</span></a></td> </tr> </table> <p><a id="CIHJEAJA" name="CIHJEAJA"></a></p> <div class="sect2"> <h1><a name="HTMDB25492" id="HTMDB25492"></a>Referencing Items Using JavaScript<a id="sthref1308" name="sthref1308"></a><a id="sthref1309" name="sthref1309"></a></h1> <p>When you reference an item, the best approach is to reference by ID. If you view the HTML source of an Oracle Application Express page in a Web browser, you would notice that all items have an id attribute. This id corresponds to the name of the item, not the item label. For example, if you create an item with the name <code>P1_FIRST_NAME</code> and a label of <code>First Name</code>, the ID will be P1_FIRST_NAME.</p> <p>Knowing the item ID enables you to use the JavaScript method <code>getElementById()</code> to get and set item attributes and values. The following example demonstrates how to reference an item by ID and display its value in an alert box.</p> <pre xml:space="preserve" class="oac_no_warn"> <script language="JavaScript1.1" type="text/javascript"> function firstName(){ alert('First Name is ' + document.getElementById('P1_FIRST_NAME').value ); } // or a more generic version would be function displayValue(id){ alert('The Value is ' + document.getElementById(id).value ); } </script> // Then add the following to the "Form Element Attributes" Attribute of the item: onchange="displayValue('P1_FIRST_NAME');" </pre></div> <!-- class="sect2" --> <!-- Start Footer --> <div class="footer"> <table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%"> <col width="86%" /> <col width="*" /> <tr> <td align="left"><span class="copyrightlogo">Copyright © 2003, 2009, Oracle and/or its affiliates. All rights reserved.</span><br /> <a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td> <td align="center"><a href="bldapp_js.htm"><img src="dcommon/gifs/leftnav.gif" alt="Previous" /><br /> <span class="icon">Previous</span></a> </td> <td align="center"><a href="bldapp_js_functions.htm"><img src="dcommon/gifs/rightnav.gif" alt="Next" /><br /> <span class="icon">Next</span></a></td> </tr> </table> </div> <!-- class="footer" --> </body> </html>
Ms-Dos/Windows
Unix
Write backup
jsp File Browser version 1.2 by
www.vonloesch.de