Subject: JavaScriopt booking form
Posted By: yatesie Post Date: 11/26/2003 10:50:40 AM
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!
Reply By: Incognito Reply Date: 11/26/2003 10:56:12 AM
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>


Reply By: yatesie Reply Date: 11/26/2003 10:57:42 AM
You're a star. Thanks :D

Carpe Diem!

Go to topic 6822

Return to index page 998
Return to index page 997
Return to index page 996
Return to index page 995
Return to index page 994
Return to index page 993
Return to index page 992
Return to index page 991
Return to index page 990
Return to index page 989