www.webdeveloper.com
Results 1 to 2 of 2

Thread: Noob w/Java headache

  1. #1
    Join Date
    Dec 2002
    Location
    Western Oklahoma Badlands
    Posts
    1

    Unhappy Noob w/Java headache

    I having a problem with a java script button used for two functions, one is info submit, the other is complete all blanks completely.

    Here's the HTML:

    <HTML>
    <HEAD>
    <TITLE>Touchstone Booksellers</TITLE>

    <SCRIPT LANGUAGE="JavaScript">
    <!--

    function submitted() {
    alert("Information submitted!")

    function verify() {
    if (document.info.elements[0].value == "" ||
    document.info.elements[1].value == "" ||
    document.info.elements[2].value == "" ||
    document.info.elements[3].value == "" ||
    document.info.elements[4].value == "" ||
    document.info.elements[5].value == "" ||
    document.info.elements[6].value == "") {
    alert("Please complete each field.")
    } else {
    submitted()
    }
    }
    //-->
    </SCRIPT>

    </HEAD>

    <BODY BGCOLOR="#38B0DE">
    <B><DIV ALIGN="center"><FONT SIZE=7 face=arial>
    Touchstone Booksellers</FONT></B>
    <BR>
    <IMAGE SRC="BOOK1.jpg">
    <H3><FONT FACE="arial">a locally-owned, independent bookstore since 1948</H3>
    <BR><H1>Specializing in nonfiction of all types</H1></B>
    </DIV>

    <BR>

    <H3>You can use our Web site to search our current stock, place an order, request a search for an out-of-print book, or find out about upcoming events at our store.</H3>

    <BR>

    <UL type="disk"><LI><A HREF="Construction.htm">Search our stock</A><BR><BR>
    <LI><A HREF="Construction.htm">Place an order</A><BR><BR>
    <LI><A HREF="Construction.htm">Out-of-print searches</A><BR><BR>
    <LI><A HREF="Construction.htm">Events calendar</A></UL>

    <H2>Sign up for our mailing list:</H2>
    <FORM NAME="info">
    First Name:<INPUT TYPE="TEXT" SIZE=20 ID="firstname">
    Last Name: <INPUT TYPE="TEXT" SIZE=20 ID="lastname">
    <BR>
    Street Address:<INPUT TYPE="TEXT" SIZE=50 ID="address">
    <BR>
    City: <INPUT TYPE="TEXT" SIZE=20 ID="city">
    State:<INPUT TYPE="TEXT" SIZE=6 ID="state">
    Zip Code:<INPUT TYPE="TEXT" SIZE=15 ID="zipcode"><BR>
    Email:<INPUT TYPE="TEXT" SIZE=40 ID="email">
    <BR>Click here to submit this information. <INPUT TYPE="BUTTON" VALUE="Send now!" onClick="submitted()">
    </FORM>

    </BODY>
    </HTML>

  2. #2
    Join Date
    Dec 2002
    Location
    Calgary, Canada
    Posts
    2,653
    I am sorry if I missed it, but I could not make it that what exactly was your problem.
    Though there was a problem with your JavaScript which I have fixed..here is the code

    function submitted() {
    alert("Information submitted!")
    }

    function verify() {
    if (document.info.elements[0].value == "" ||
    document.info.elements[1].value == "" ||
    document.info.elements[2].value == "" ||
    document.info.elements[3].value == "" ||
    document.info.elements[4].value == "" ||
    document.info.elements[5].value == "" ||
    document.info.elements[6].value == "") {
    alert("Please complete each field.")
    } else {
    submitted()
    }
    }

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles