Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Dec 2004
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Please help with Form Duplicate button

    Trying to code the script so that when the use above fields info button is selected, the previous info is entered into the billing info and vise-versa... no checkbox = no info. Having a few issues. Can someone please check it out for me and give me some feedback. Thanks!!!


    <html>

    <head>
    <meta http-equiv="Content-Language" content="en-us">
    <meta name="GENERATOR" content="Microsoft FrontPage 5.0">
    <meta name="ProgId" content="FrontPage.Editor.Document">
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <script>

    //"Accept terms" form submission- By Dynamic Drive
    //For full source code and more DHTML scripts, visit http://www.dynamicdrive.com
    //This credit MUST stay intact for use

    var checkobj

    function agreesubmit(el){
    checkobj=el
    if (document.all||document.getElementById){
    for (i=0;i<checkobj.form.length;i++){ //hunt down submit button
    var tempobj=checkobj.form.elements[i]
    if(tempobj.type.toLowerCase()=="submit")
    tempobj.disabled=!checkobj.checked
    }
    }
    }

    function defaultagree(el){
    if (!document.all&&!document.getElementById){
    if (window.checkobj&&checkobj.checked)
    return true
    else{
    alert("Please read/accept terms to submit form")
    return false
    }
    }
    }

    </script>
    <SCRIPT LANGUAGE="JavaScript">
    <!-- Begin
    var fname = "";
    var lname = "";
    var address = "";
    var city = "";
    var state = "";
    var stateindex = 0;
    var zip = "";

    function InitSaveVariables(form) {
    fname = form.fname.value;
    lname = form.lname.value;
    address = form.address.value;
    city = form.city.value;
    stateindex = form.state.selectedIndex;
    state = form.state[stateindex].value;
    }

    function ShipToBillPerson(form) {
    if (form.copy.checked) {
    InitSaveVariables(form);
    form.fname.value = form.bfname.value;
    form.lname.value = form.blname.value;
    form.address.value = form.baddress.value;
    form.city.value = form.bcity.value;
    form.state.value = form.bstate.value;
    form.state.selectedIndex = form.bstate.selectedIndex;
    form.zip.value = form.bzip.value;
    }
    else {
    form.bfname.value = bfname;
    form.blname.value = blname;
    form.baddress.value = baddress;
    form.bcity.value = bcity;
    form.bstate.value = bstate
    form.bstate.selectedIndex = bstateindex;
    form.bzip.value = bzip;
    }
    }
    // End -->
    </script>

    <title>Payment Type</title>
    </head>

    <body bgcolor="#99CCFF">

    <p align="center">&lt;Insert Logo Here&gt;</p>
    <form method="POST" action="createaccount.php">
    <form name="form" onSubmit="return defaultagree(this)">
    <p align="center">
    <b>Please fill out the form below to receive your username and password</b>:</p>
    <p align="left">First:
    <!--webbot bot="Validation" s-data-type="String" b-allow-letters="TRUE" b-value-required="TRUE" --><input type="text" name="fname" size="20">&nbsp;&nbsp;&nbsp;
    Last:
    <!--webbot bot="Validation" s-data-type="String" b-allow-letters="TRUE" b-value-required="TRUE" --><input type="text" name="lname" size="20"></p>
    <p align="left">Address:
    <!--webbot bot="Validation" s-data-type="String" b-allow-letters="TRUE" b-allow-digits="TRUE" b-value-required="TRUE" --><input type="text" name="address" size="45">
    </p>
    <p align="left">City:
    <!--webbot bot="Validation" s-data-type="String" b-allow-letters="TRUE" b-value-required="TRUE" --><input type="text" name="city" size="20">&nbsp;&nbsp;&nbsp;
    State:&nbsp; <!--webbot bot="Validation" b-value-required="TRUE" --><select size="1" name="state">
    <option selected>
    <option value="AL">ALABAMA
    <option value="AK">ALASKA
    <option value="AZ">ARIZONA
    <option value="AR">ARKANSAS
    <option value="CA">CALIFORNIA
    <option value="CO">COLORADO
    <option value="CT">CONNECTICUT
    <option value="DE">DELAWARE
    <option value="FL">FLORIDA
    <option value="GA">GEORGIA
    <option value="HI">HAWAII
    <option value="ID">IDAHO
    <option value="IL">ILLINOIS
    <option value="IN">INDIANA
    <option value="IA">IOWA
    <option value="KS">KANSAS
    <option value="KY">KENTUCKY
    <option value="LA">LOUISIANA
    <option value="ME">MAINE
    <option value="MD">MARYLAND
    <option value="MA">MASSACHUSETTS
    <option value="MI">MICHIGAN
    <option value="MN">MINNESOTA
    <option value="MS">MISSISSIPPI
    <option value="MO">MISSOURI
    <option value="MT">MONTANA
    <option value="NE">NEBRASKA
    <option value="NV">NEVADA
    <option value="NH">NEW HAMPSHIRE
    <option value="NJ">NEW JERSEY
    <option value="NM">NEW MEXICO
    <option value="NY">NEW YORK
    <option value="NC">NORTH CAROLINA
    <option value="ND">NORTH DAKOTA
    <option value="OH">OHIO
    <option value="OK">OKLAHOMA
    <option value="OR">OREGON
    <option value="PA">PENNSYLVANIA
    <option value="RI">RHODE ISLAND
    <option value="SC">SOUTH CAROLINA
    <option value="SD">SOUTH DAKOTA
    <option value="TN">TENNESSEE
    <option value="TX">TEXAS
    <option value="UT">UTAH
    <option value="VT">VERMONT
    <option value="VA">VIRGINIA
    <option value="WA">WASHINGTON
    <option value="DC">WASHINGTON, D.C.
    <option value="WV">WEST VIRGINIA
    <option value="WI">WISCONSIN
    <option value="WY">WYOMING
    </select>&nbsp;&nbsp;&nbsp; Zip Code:
    <!--webbot bot="Validation" s-data-type="String" b-allow-digits="TRUE" b-value-required="TRUE" i-minimum-length="5" i-maximum-length="5" --><input type="text" name="zip" size="13" maxlength="5"></p>
    <hr>
    <p align="left"><b>Pass Type</b>:</p>
    <p align="left">
    <!--webbot bot="Validation" b-value-required="TRUE" b-disallow-first-item="TRUE" --><select size="1" name="ptype">
    <option>--Pass Type--</option>
    <option>Day Pass $ 3.99</option>
    <option>Monthly Pass $ 39.99</option>
    <option>Yearly Pass $ 149.99</option>
    </select></p>
    <hr>
    <p align="left"><b>Payment Type</b>:</p>
    <p align="left">
    <!--webbot bot="Validation" b-value-required="TRUE" b-disallow-first-item="TRUE" --><select size="1" name="payment">
    <option>--Payment--</option>
    <option>Visa</option>
    <option>Mastercard</option>
    <option>Discover</option>
    </select> </p>
    <p align="left">Name as it appears on Card:
    <!--webbot bot="Validation" s-data-type="String" b-allow-letters="TRUE" b-value-required="TRUE" --><input type="text" name="cname" size="39"></p>
    <p align="left">Number on Card:
    <!--webbot bot="Validation" s-data-type="String" b-allow-digits="TRUE" b-value-required="TRUE" i-minimum-length="16" i-maximum-length="16" --><input type="text" name="cnumber" size="33" maxlength="16"></p>
    <p align="left">Expiration:
    <!--webbot bot="Validation" b-value-required="TRUE" --><select size="1" name="cexpiration">
    <option>-Mo-</option>
    <option>01</option>
    <option>02</option>
    <option>03</option>
    <option>04</option>
    <option>05</option>
    <option>06</option>
    <option>07</option>
    <option>08</option>
    <option>09</option>
    <option>10</option>
    <option>11</option>
    <option>12</option>
    </select><!--webbot bot="Validation" b-value-required="TRUE" --><select size="1" name="cexpiration2">
    <option>-Year-</option>
    <option>2004</option>
    <option>2005</option>
    <option>2006</option>
    <option>2007</option>
    <option>2008</option>
    <option>2009</option>
    <option>2010</option>
    <option>2011</option>
    <option>2012</option>
    <option>2013</option>
    <option>2014</option>
    <option>2015</option>
    </select></p>
    <p align="left">Last 3 Digits on Back Side of Card:
    <!--webbot bot="Validation" s-data-type="String" b-allow-digits="TRUE" b-value-required="TRUE" i-minimum-length="3" i-maximum-length="3" --><input type="text" name="cverify" size="7" maxlength="3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <a title="Click to see full sceen" target="_blank" href="images/cvn_3digit.gif">
    <img border="2" src="cvn_3digit_small.gif" xthumbnail-orig-image="images/cvn_3digit.gif" width="100" height="69"></a></p>
    <hr>
    <p align="left"><b>Billing Address</b> (as it appears on Credit Card
    Statement):</p>
    (Check if Billing is the Same as Above: <input type="checkbox" name="copy"
    OnClick="javascript:ShipToBillPerson(this.form);" value="checkbox"> )
    <p align="left">First:
    <!--webbot bot="Validation" s-data-type="String" b-allow-letters="TRUE" b-value-required="TRUE" --><input type="text" name="bfname" size="20">&nbsp;&nbsp;&nbsp;
    Last:
    <!--webbot bot="Validation" s-data-type="String" b-allow-letters="TRUE" b-value-required="TRUE" --><input type="text" name="blname" size="20"></p>
    <p align="left">Address:
    <!--webbot bot="Validation" s-data-type="String" b-allow-letters="TRUE" b-allow-digits="TRUE" b-value-required="TRUE" --><input type="text" name="baddress" size="45"></p>
    <p align="left">City:&nbsp;<!--webbot bot="Validation" s-data-type="String" b-allow-letters="TRUE" b-value-required="TRUE" --><input type="text" name="bcity" size="20">&nbsp;&nbsp; State:&nbsp;
    <select size="1" name="bstate">
    <option selected>
    <option value="AL">ALABAMA
    <option value="AK">ALASKA
    <option value="AZ">ARIZONA
    <option value="AR">ARKANSAS
    <option value="CA">CALIFORNIA
    <option value="CO">COLORADO
    <option value="CT">CONNECTICUT
    <option value="DE">DELAWARE
    <option value="FL">FLORIDA
    <option value="GA">GEORGIA
    <option value="HI">HAWAII
    <option value="ID">IDAHO
    <option value="IL">ILLINOIS
    <option value="IN">INDIANA
    <option value="IA">IOWA
    <option value="KS">KANSAS
    <option value="KY">KENTUCKY
    <option value="LA">LOUISIANA
    <option value="ME">MAINE
    <option value="MD">MARYLAND
    <option value="MA">MASSACHUSETTS
    <option value="MI">MICHIGAN
    <option value="MN">MINNESOTA
    <option value="MS">MISSISSIPPI
    <option value="MO">MISSOURI
    <option value="MT">MONTANA
    <option value="NE">NEBRASKA
    <option value="NV">NEVADA
    <option value="NH">NEW HAMPSHIRE
    <option value="NJ">NEW JERSEY
    <option value="NM">NEW MEXICO
    <option value="NY">NEW YORK
    <option value="NC">NORTH CAROLINA
    <option value="ND">NORTH DAKOTA
    <option value="OH">OHIO
    <option value="OK">OKLAHOMA
    <option value="OR">OREGON
    <option value="PA">PENNSYLVANIA
    <option value="RI">RHODE ISLAND
    <option value="SC">SOUTH CAROLINA
    <option value="SD">SOUTH DAKOTA
    <option value="TN">TENNESSEE
    <option value="TX">TEXAS
    <option value="UT">UTAH
    <option value="VT">VERMONT
    <option value="VA">VIRGINIA
    <option value="WA">WASHINGTON
    <option value="DC">WASHINGTON, D.C.
    <option value="WV">WEST VIRGINIA
    <option value="WI">WISCONSIN
    <option value="WY">WYOMING
    </select>&nbsp;&nbsp; Zip Code:
    <!--webbot bot="Validation" s-data-type="String" b-allow-digits="TRUE" b-value-required="TRUE" i-minimum-length="5" i-maximum-length="5" --><input type="text" name="bzip" size="13" maxlength="5"></p>
    <hr>
    <p align="left"><b>Customer Service Agreement</b>:</p>
    <p align="left"><iframe name="I1" width="864" height="150" src="CSA.html">
    Your browser does not support inline frames or is currently configured not to display inline frames.</iframe></p>
    <p align="left">I have read and understand the terms and conditions outlined
    by under the Customer Service Agreement:
    <input name="agreecheck" type="checkbox" onClick="agreesubmit(this)" value="ON"></p>
    <p align="center">
    <input type="submit" value="Sign Up" disabled value="Sign Up" name="B1"><input type="reset" value="Reset" name="B2"></p>
    </form>

    <p align="center"><img border="0" src="images/visa.gif" width="62" height="43"><img border="0" src="images/mastercard.gif" width="66" height="43"><img border="0" src="images/discover.gif" width="66" height="43"></p>
    <p><font size="2">*** Sensitive payment information (such as credit card
    numbers) is encrypted and is protected with 128-bit encryption using SSL 3.0
    during transmission to our server.&nbsp; While on a secure page, such as our payment
    form, the lock icon at the bottom of Web browsers, such as Netscape Navigator
    and Microsoft Internet Explorer, becomes locked.&nbsp; To learn more about SSL,
    follow this link:
    <a target="_blank" href="http://developer.netscape.com/tech/security/ssl/protocol.html">http://developer.netscape.com/tech/security/ssl/protocol.html</a>. </font></p>
    <p align="center">&nbsp;</p>

    </body>

    </html>

  • #2
    New to the CF scene
    Join Date
    Dec 2004
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Never Mind... Lack of sleep was getting to me... I figured it out this morning

  • #3
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,252
    Thanks
    203
    Thanked 2,557 Times in 2,535 Posts
    The mods removed your previous posts.
    Your user name is still unpleasantly crude and I hope the mods will insist that you re-register under a more palatable name.


  •  

    Posting Permissions

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