Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Other Java > Java Databases
|
Java Databases Discussion specific to working with Java Databases. For other Java topics, please see related Java forums. For database discussions not specific to Java, please see the Database category.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Java Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 26th, 2003, 11:50 AM
Registered User
 
Join Date: Nov 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default JavaScriopt booking form

Just joined so please go easy on me. I need help with a script for making an online booking form. Just to include details like:

First Name:
MI:
Last Name:
Address:
Phone:
Postal Code:
Email Address:
Birthday: DD: MM: YYYY:
Credit Card:


Thanks in advance

Carpe Diem!
 
Old November 26th, 2003, 11:56 AM
Registered User
 
Join Date: Nov 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Here you go buddy. Hope this helps.
;)

<HTML>
  <HEAD><SCRIPT SRC="valid.js" ID="sqValidator"></SCRIPT><SCRIPT LANGUAGE="JavaScript" ID="sqValidate"><!--
function validate(theForm)
    {
    var formTest = true;
    if (checkName(theForm.fname) != true) {formTest = false};
    if (checkName(theForm.initial) != true) {formTest = false};
    if (checkName(theForm.lname) != true) {formTest = false};
    if (checkAddress(theForm.addr) != true) {formTest = false};

    if (theForm.country == "")


    if (checkEmail(theForm.email) != true) {formTest = false};
    if (checkDate(theForm.day, theForm.month, theForm.year, "birthday") != true) {formTest = false};
    if (checkCreditCard(theForm.cctype,theForm.cc) != true) {formTest = false};
    return (formTest);
    }
// -->
</SCRIPT>
     <TITLE></TITLE>
  </HEAD>
  <BODY>
     <FORM METHOD="POST" ACTION="" ONSUBMIT="validate(this)" ID="myform">
        <TABLE WIDTH="75%">
          <TR>
             <TD>First Name:</TD>
             <TD><INPUT TYPE="TEXT" SIZE="30" NAME="fname"></TD>
          </TR>
          <TR>
             <TD>MI:</TD>
             <TD><INPUT TYPE="TEXT" SIZE="30" NAME="initial"></TD>
          </TR>
          <TR>
             <TD>Last Name:</TD>
             <TD><INPUT TYPE="TEXT" SIZE="30" NAME="lname"></TD>
          </TR>
          <TR>
             <TD>Address:</TD>
             <TD><INPUT TYPE="TEXT" SIZE="30" NAME="addr"></TD>
          </TR>
          <TR>
             <TD>Phone:</TD>
             <TD><INPUT TYPE="TEXT" SIZE="15" NAME="phone"></TD>
          </TR>
          <TR>
             <TD>Postal Code:</TD>
             <TD><INPUT TYPE="TEXT" SIZE="30" NAME="pcode"></TD>
          </TR>
          <TR>
             <TD>Email Address:</TD>
             <TD><INPUT TYPE="TEXT" SIZE="30" NAME="email"></TD>
          </TR>
          <TR>
             <TD>Birthday:</TD>
             <TD>DD: <INPUT TYPE="TEXT" SIZE="2" NAME="year"> MM:
                <INPUT TYPE="TEXT" SIZE="2" NAME="month"> YYYY:
                <INPUT TYPE="TEXT" SIZE="4" NAME="day"></TD>
          </TR>
          <TR>
             <TD VALIGN="TOP">Credit Card:</TD>
             <TD><INPUT TYPE="TEXT" SIZE="30" NAME="cc" VALUE=""><BR>
                <INPUT TYPE="RADIO" VALUE="VISA" NAME="cctype" CHECKED="CHECKED">Visa Sample
                number: 4111 1111 1111 1111<BR>
                <INPUT TYPE="RADIO" VALUE="MASTERCARD" NAME="cctype">MC Sample number: 5500
                0000 0000 0004<BR> <INPUT TYPE="RADIO" VALUE="AMERICANEXPRESS"
                NAME="cctype">AMEX Sample number: 340000000000009 </TD>
          </TR>
          <TR>
             <TD>&nbsp;</TD>
             <TD><INPUT TYPE="SUBMIT" VALUE="Submit Form"><INPUT TYPE="BUTTON"
                NAME="Validate" VALUE="Validate Data" ONCLICK="validate(myform)"></TD>
          </TR>
        </TABLE> </FORM> </BODY>
</HTML>


 
Old November 26th, 2003, 11:57 AM
Registered User
 
Join Date: Nov 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You're a star. Thanks :D

Carpe Diem!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Java code for Booking form riaz Java GUI 10 May 17th, 2007 09:33 AM
Booking program. Tankey Access 1 May 2nd, 2006 03:56 PM
Booking form hameed123 PHP How-To 1 May 12th, 2005 11:22 AM
Forward Booking rahilahmed Excel VBA 0 May 24th, 2004 09:25 AM
booking form LITOTES PHP How-To 2 June 4th, 2003 03:46 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.