Custom Search
www.rocket99.com : Technical Guides Sybase Oracle UNIX Javascript


Technical Guides
Sybase
Oracle
UNIX
Javascript




Of Interest

Business Intelligence and Analytics



Oracle Training





Javascript » Methods » Coding »

Dynamic Objects and Names

     





<script language=javascript>
<!--
//--------------------------------------------------------------------------
function f_test1()
{
alert(frm_main.elements[3].name);
alert(frm_main.elements[3].value);
}
function f_test2()
{
alert(frm_main.elements[4].name);
alert(frm_main.elements[4].value);
}
function f_test3()
{
alert(frm_main.elements[5].name);
alert(frm_main.elements[5].value);
}
// -->
</script>



Object names and values

This example depicts how to get object names and values dynamically within Javascript.
When the first checkbox is clicked, it gives the name and value of the first
label within the form. Note that the first field is element #3.


<form name=frm_main>

<center>

<input name=cbx_1 type=checkbox value="1" checked=false onclick="f_test1()">

<input name=cbx_2 type=checkbox value="1" checked=false onclick="f_test2()">

<input name=cbx_3 type=checkbox value="1" checked=false onclick="f_test3()">

<hr>

<input name=fld_atest value=Orange>


<input name=fld_xtest value=Apple>

<input name=fld_ztest value=Lemon>








Object names and values

This example depicts how to get object names and values dynamically within Javascript. When the first checkbox is clicked, it gives the name and value of the first label within the form. Note that the first field is element #3.
































Javascript : Related Topics

Javascript : Methods : Incrementing a counter within an edit field
Javascript : Methods : Animation Example
Javascript : Methods : Image Mapping Example
Javascript : Methods : Redirecting Page Access
Javascript : Methods : Loading a new page dynamically
Javascript : Methods : Complex Application with Forms
Javascript : Methods : Image Viewer with Prev and Next Buttons
Javascript : Methods : Array Processing, Frameset Writes
Javascript : Methods : Javascript: Where it fits in HTML
Javascript : Methods : Accessing the cookie file
Javascript : Methods : Using include files
Javascript : Methods : Pure virtual call error
Javascript : Methods : Passing variables to windows
Javascript : Methods : Executing Dynamic Code
Javascript : Methods : Single line edit: Data entry issue
Javascript : Methods : Call CGI counter
Javascript : Methods : Setting Focus to a Control During Load

Sybase Web Site
Sybase iAnywhere Mobile Web Site
Oracle Enterprise Web Site



Get the latest Rocket99 news and tech tips via






Site Index About this Guide to Sybase, Oracle, and UNIX Contact Us Advertise on this site




Copyright © 2016 Stoltenbar Inc All Rights Reserved.