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 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Need help with this form code- please

    First, if I am posting this in the wrong forum I apologize.

    I am definitely a jack-of-a-bunch-of-things and a master of none especially coding and would appreciate any help or guidance.

    Below is a code from a page in a template that is a registration page with 3 input options. I want to remove the first two options and only keep the option that a person has to agree to terms and conditions. I know enough to remove the 2 input boxes and have tried removing the code that makes these 2 form fields "required", but after doing so the submit button doesn't work.

    ( i did not remove anything so that you could see the code as it is)

    I hope I was clear and would appreciate any help. Here is original code:

    ___________________________________

    Code:
    <form action="register_affiliate.asp" method="post" name="frmForm">
    <input type="hidden" name="action" id="action" value="">
    
    <table width="95%" cellpadding="0" cellspacing="0" border="0">
    <tr>
    <td class="page_headers">[affiliate_register]</td></tr>
    
    
    
    <!--START: CATEGORY_HEADER-->
    
    <tr>
    <td class="data"> [CONTENT]<br /><br /></td>
    </tr>
    
    <!--END: CATEGORY_HEADER-->
    
    <tr><td>
    
    <table width="85%" cellpadding="5" cellspacing="0" border="0">
    <tr>
    
    <td class="item"><b>If You Have A Website, Please Enter Address:</b><br />
    <input name="txtWebsite" type="text" id="txtWebsite" size="45" class="txtBoxStyle" value="[strWebsite]" maxlength="100"> <img src="assets/templates/common/images/error2.gif" width="12" height="12">
    </td>
    </tr>
    <tr>
    
    <td class="item"><b>Tax ID#:</b><br /><input name="txtTaxId" type="text" id="txtTaxId" size="15" class="txtBoxStyle" value="[strTaxId]" maxlength=12> <img src="assets/templates/common/images/error2.gif" width="12" height="12"> (SSN# or EIN#)</td>
    </tr>
    <tr>
    
    <td class="item"><b>Terms and Conditions:</b><br />
    <textarea rows=12 cols=40 id="txtTerms" name="txtTerms" readonly="readonly">[affiliate_register-terms-condition]</textarea>
    <br>
    <input type="checkbox" id="chkAcceptTerms" name="chkAcceptTerms" value="1" [bolAccept]> I accept the terms and conditions
    <img src="assets/templates/common/images/error2.gif" width="12" height="12">
    </td>
    </tr>
    <tr><td>
    <tr><td>
    <span class="error"><img src="assets/templates/common/images/error2.gif"> = Required</span></td></tr>
    <tr><td align="left"><input type="button" name="cmdProceed" value="Proceed" onclick="javascriptroceed();" class="btn"></td></tr>
    </table>
    </td>
    </tr>
    
    
    
    
    <!--START: CATEGORY_FOOTER-->
    
    <tr>
    <td class="data">[CONTENT]</td>
    </tr>
    
    <!--END: CATEGORY_FOOTER-->
    </table>
    </form>
    
    
    <script language="javascript" type="text/javascript">
    var addReplyClick = 0;
    
    function submitForm(strAction)
    {
    window.document.body.style.cursor = 'wait';
    if(window.document.activeElement){window.document.activeElement.style.cursor='wait'; }
    
    document.frmForm.action.value = strAction;
    document.frmForm.submit();
    }
    function proceed()
    {
    var strMsg = "";
    if (document.frmForm.txtWebsite.value.trim() == "")
    strMsg += " - Website address cannot be blank.\n"
    if (document.frmForm.txtTaxId.value.trim() == "")
    strMsg += " - Tax ID cannot be blank.\n"
    if (!document.frmForm.chkAcceptTerms.checked)
    strMsg += " - You must read and accept Terms and Conditions before proceed.\n"
    if (strMsg != ""){
    alert(strMsg);
    return false;
    }
    if (addReplyClick == 0){
    addReplyClick = 1;
    submitForm('register');
    }
    }
    String.prototype.trim = function() {
    return this.replace(/^\s+|\s+$/g,"");
    }
    </script>

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Remove the fields and then just remove this
    Code:
    if (document.frmForm.txtWebsite.value.trim() == "")
    strMsg += " - Website address cannot be blank.\n"
    if (document.frmForm.txtTaxId.value.trim() == "")
    strMsg += " - Tax ID cannot be blank.\n"
    ||||If you are getting paid to do a job, don't ask for help on it!||||


  •  

    Posting Permissions

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