Announcement

Collapse
No announcement yet.

Min field lenght

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Min field lenght

    Hi

    I know this might be a silly question but is there any way that I can set a field lenght to a min of six charaters.

    I.e I'm trying to use the Fax field as a Password field that requires 6-10 charaters.

    Many Thanks

    Jay

    #2
    Hi there

    Go to "Advance | Template Manager". Click on the "Ordering" tab along the top, then click on "Order Phase 1".

    This will bring up "Act_Order01.html". You should see the following code around here:

    Code:
    <tr>
        <td bgcolor="NETQUOTEVAR:CHECKOUTBG">NETQUOTEVAR:INVOICEPROMPT011</td>
        <td bgcolor="NETQUOTEVAR:CHECKOUTBG">
          <input type="TEXT" name="INVOICEFAX" size="20" maxlength="25" value="NETQUOTEVAR:INVOICEFAX">
        </td>
      </tr>
    Simply change the size.

    Kind Regards
    Nadeem Rasool
    SellerDeck Development

    Comment


      #3
      Thank you.

      I've all ready done this as I thought it would be the answer, but the page still allows me to proceed if I enter only one character.

      Any Ideas?

      Url: www.choicefreerange.com

      Comment


        #4
        This requires a JavaScript function - which I have got from:

        http://www.codeave.com/javascript/code.asp?u_log=7044

        Put this code into the <head> section of the overall layout template you are using for the checkout phase. This will be specified in 'Design | Options | Layouts'. Enter the code just before the </head>
        Code:
        <script Language="JavaScript">
        <!-- 
        function Length_TextField_Validator()
        {
        // Check the length of the value of the element named text_name
        // from the form named form_name if it's < 3 and > 10 characters
        // display a message asking for different input
        if ((document.forms[0].INVOICEFAX.value.length < 6) || (document.forms[0].INVOICEFAX.value.length > 10))
        {
        // Build alert box message showing how many characters entered
        mesg = "You have entered " + document.forms[0].INVOICEFAX.value.length + " character(s)\n"
        mesg = mesg + "Valid entries are between 6 and 10 characters.\n"
        mesg = mesg + "Please verify your input and submit again."
        alert(mesg);
        // Place the cursor on the field for revision
        document.forms[0].INVOICEFAX.focus();
        // return false to stop further processing
        return (false);
        }
        // If text_name is not null continue processing
        return (true);
        }
        -->
        </script>
        Then open Act_Order01.html and locate the line that reads:
        Code:
           <input type=SUBMIT name=ACTION value="NETQUOTEVAR:NEXTBUTTON">
        Edit this so it reads:
        Code:
           <input type=SUBMIT name=ACTION value="NETQUOTEVAR:NEXTBUTTON" onClick="return (Length_TextField_Validator());">

        Comment

        Working...
        X