spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

Developer News
Cisco Lawsuit: A Test for the GPL?
Shifts for Enterprise Linux, Green Networks in '09
Gifts for All in Linux 2.6.28
JavaScript Tip of the Week for June 10, 1996: Source Code: A Closer Look at Forms


Source code for the forms:
    <INPUT TYPE = "text" NAME = "user_name" VALUE = " type name here">
    <BR>    
    <INPUT TYPE = "radio" NAME = "Choice" VALUE = "1"
     onClick = "user_choice = 1">Apple<BR>
    <INPUT TYPE = "radio" NAME = "Choice" VALUE = "2"
     onClick = "user_choice = 2">Microsoft<BR>
    <INPUT TYPE = "radio" NAME = "Choice" VALUE = "3"
     onClick = "user_choice = 3">Netscape<BR>
    
    <INPUT TYPE = "button" NAME = "Okay_Then" VALUE = "Okay Then"
     onClick = "process(this.form)">




Source code for the form processing function, must come after the form code:
/* This code is Copyright (c) 1996 Nick Heinle and Athenia Associates, 
 * all rights reserved. In order to receive the right to license this 
 * code for use on your site the original code must be copied from the
 * Web site webreference.com/javascript/. License is granted to user to 
 * reuse this code on their own Web site if and only if this entire copyright
 * notice is included. Code written by Nick Heinle of webreference.com.
 */

function process()
    {
    if (user_choice == 0){
        alert("Fill out the form first!");
        }

    if (user_choice == 1){
        alert("Well " + document.test_form.user_name.value +
               ", you better hope Amelio turns Apple around.");
        }

    if (user_choice == 2){
        alert("Definitely a solid choice " + 
                document.test_form.user_name.value + ".");
        }

   if (user_choice == 3){
        alert("Stock goes up... Stock goes down... You\'re in for a rough ride "
                + document.test_form.user_name.value + " :-\)");
        }
    }

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

webref The latest from WebReference.com Browse >
Overview of Popular JavaScript Frameworks - ASP.NET AJAX · An Introduction to 3D · Email Marketing Terms to Know
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Configuring Anonymous Dialog Security in SQL Server 2005 Express Service Broker Conversation · OpenVPN: Revoking Access and Expanding Management Options · Connecticut Town Lays Groundwork for Merged School, Municipal VoIP Network