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

    need help editing this code

    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 hope I was clear and would appreciate any help. Here is original 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! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    26,233
    Thanks
    80
    Thanked 4,456 Times in 4,421 Posts
    And this has what to do with ASP?

    You are showing nothing but HTML and JavaScript here. Why is this in the ASP forum?

    And what is stuff like this supposed to be:
    Code:
    <input name="txtTaxId" type="text" id="txtTaxId" size="15" class="txtBoxStyle" value="[strTaxId]" maxlength=12>
    [/code]
    I don't know of any system (ASP or otherwise) that uses notation such as [strTaxId in the source code.

    And last but not least, you say you want to remove the website and taxid fields, but they are still sitting there. So I, for one, don't know what you did when you tried removing them.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #3
    New to the CF scene
    Join Date
    Jan 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Wow. Thanks for the help. Let's start by my admitting I'm not as smart as you and probably most that are here.

    The code started with asp and I thought this was the best place to post it.

    Couldn't you have just said, "you might get a better response in..."

    I also figured I would leave the code intact as it was and not show what I removed so one could better see it all.

    Why do some people feel like they have to talk over someone's else's head?

    Here's something for you... "in all things, it's better to work with the construction gang and not the wrecking crew".

    With 2700 previous "thanks", I can't believe you'd be so rude this time.
    Last edited by DuaneV; 01-06-2012 at 03:06 AM.

  • #4
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    26,233
    Thanks
    80
    Thanked 4,456 Times in 4,421 Posts
    *SIGH* Look, I'm not trying to belittle you or berate you, I'm trying to understand just what the problem *IS*.

    That simply doesn't look to me like it is *REAL* code.

    When I said I don't know of any system that uses
    Code:
       ...  value="[strTaxId]" ...
    I was serious. I don't. And so I was *assuming* that what you are showing us is not the real code.

    If that really *IS* the code then I don't at all undestand how it is supposed to work and you have me utterly stumped.

    In ASP code, I would have expected to maybe see something like
    Code:
        ... value="<%=strTaxId%>" ...
    That makes sense to me. (That happens to also work in JSP, but that's surely not relevant here.)

    But what transformed <%= ... %> into [...] is truly a mystery to me.

    *******

    You say you wanted to remove website and taxid fields. Okay, fine. I will believe that you removed them.

    But did you *ALSO* then remove the JavaScript code that is insisting on their existence?

    I can not possibly know.

    If you didn't, then the first step is to change the javascript code to get rid of those checks.

    If you *did* remove the JavaScript code, then possibly the problem isn't here, at all, but is instead in the "register_affiliate.asp" page. And *THAT* is why I asked if this is really an ASP question or not. If it really is, then we'd need to see the code for that other page to tell you what to change in it to allow a form posting with those two fields missing.

    ********

    In other words, you quite simply didn't give anybody enough information to work with.

    If you *had* shown us the page where (let us say) you had removed the form fields but hadn't changed the JavaScript code, then the first step would be to change the JS code.

    Or if you *had* shown us a page where (again supposing) you had removed the form fields *and* correctly modified the JS code, then we would know for sure that the problem is not on this page.

    And, finally, if you would tell us (me!) what the heck [strTaxId] is supposed to be/mean/represent, maybe I'd be a lot less mystified.

    As it is, you are asking me why your car won't start without telling me if you have turned on the ignition.
    Last edited by Old Pedant; 01-06-2012 at 04:51 AM.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Posting Permissions

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