

<?xml version="1.0" encoding="UTF-8"?>
	<rss version="2.0"
		xmlns:content="http://purl.org/rss/1.0/modules/content/"
		xmlns:wfw="http://wellformedweb.org/CommentAPI/"
		xmlns:dc="http://purl.org/dc/elements/1.1/"
		xmlns:atom="http://www.w3.org/2005/Atom"

			>

	<channel>
		<title>LexiConn News  &#187;  Topic: Limiting the Length of ShopSite Checkout Fields</title>
		<atom:link href="https://support.lexiconn.com/news/forums/topic/limiting-the-length-of-shopsite-checkout-fields/feed" rel="self" type="application/rss+xml" />
		<link>https://support.lexiconn.com/news/forums/topic/limiting-the-length-of-shopsite-checkout-fields/feed</link>
		<description></description>
		<pubDate>Sun, 05 Apr 2026 12:27:37 +0000</pubDate>
		<generator>http://bbpress.org/?v=2.5.3-5249</generator>
		<language>en-US</language>

		
														
					
				<item>
					<guid>https://support.lexiconn.com/news/forums/topic/limiting-the-length-of-shopsite-checkout-fields/#post-48797</guid>
					<title><![CDATA[Limiting the Length of ShopSite Checkout Fields]]></title>
					<link>https://support.lexiconn.com/news/forums/topic/limiting-the-length-of-shopsite-checkout-fields/#post-48797</link>
					<pubDate>Mon, 12 Sep 2011 16:33:03 +0000</pubDate>
					<dc:creator>Anonymous</dc:creator>

					<description>
						<![CDATA[
						<p>You can use the following javascript on your checkout page to limit the length of text fields. It can be entered in:</p>
<p><em>Commerce Setup &gt; Order System &gt; Checkout Screen &#8211; Text at the bottom of the Checkout screen:</em></p>
<p>&nbsp;</p>
<pre>&lt;script type="text/javascript"&gt; 
 
 window.onload = function(){ 
   var LimitCheckout = { 
     useBilling: document.billing.usebilling.checked, 
     commentsBox: document.billing.Comments, 
     commentsLimit: 0, 
     billing_fields:[{ 
         Email: 0, 
         Title: 0, 
         First: 0,    
         Middle: 0, 
         Last: 0, 
         Suffix: 0, 
         Company: 0, 
         Address: 0, 
         Address2: 0, 
         City: 0,    
         Zip: 0, 
         Phone: 0 
    }], 
     shipping_fields:[{ 
         ShipTitle: 0,    
         ShipFirst: 0,      
         ShipMiddle: 0, 
         ShipLast: 0, 
         ShipSuffix: 0, 
         ShipCompany: 0,    
         ShipAddress: 0,    
         ShipAddress2: 0,    
         ShipCity: 0, 
         ShipZip: 0,            
         ShipPhone: 0 
     }], 
     limitCommentBox: function(l_val){ 
         document.billing.Comments.onkeyup = function(){ 
           if (document.billing.Comments.value.length &gt; l_val) { 
             document.billing.Comments.value = document.billing.Comments.value.substring(0, l_val); 
           } 
         } 
 
         document.billing.Comments.onkeydown = function(){ 
            if (document.billing.Comments.value.length &gt; l_val) { 
               document.billing.Comments.value = document.billing.Comments.value.substring(0, l_val); 
            } 
         } 
     }, 
     setFieldLimit: function(l_field, f_limit){ 
         var limit_field = document.getElementsByName(l_field); 
         for(m=0; m&lt;limit_field.length; m++){ 
             limit_field[m].maxLength = f_limit; 
         } 
     }, 
     limitFields: function(){ 
         
         for(var b_index in LimitCheckout.billing_fields[0]) { 
           if(LimitCheckout.billing_fields[0][b_index] &gt; 0){ 
                LimitCheckout.setFieldLimit(b_index, LimitCheckout.billing_fields[0][b_index]); 
            } 
         } 
         for(var s_index in LimitCheckout.shipping_fields[0]) { 
           if(LimitCheckout.shipping_fields[0][s_index] &gt; 0){ 
               
                LimitCheckout.setFieldLimit(s_index, LimitCheckout.shipping_fields[0][s_index]); 
            } 
         } 
 
         if(LimitCheckout.commentsBox != undefined){ 
             if(LimitCheckout.commentsLimit &gt; 0){ 
                 LimitCheckout.limitCommentBox(LimitCheckout.commentsLimit); 
             } 
         } 
     } 
         
 } 
 
     LimitCheckout.limitFields(); 
 } 
 &lt;/script&gt; 
</pre>
<p>&nbsp;</p>
<p>You will notice the script contains a list of billing fields (billing_fields) and shipping fields (shipping_fields) with a zero after each. Any field with a value of zero is not limited in length by this script. You can set any fields you would like to be restricted to the maximum number of characters you would like to allow for the field and the field will be restricted. You can also restrict the length of the text in the Customer Comments box (if you are using one on your checkout page) using the:</p>
<p><em>commentsLimit: 0</em></p>
<p>variable in the script.</p>
						]]>
					</description>

					
					
				</item>

					
		
	</channel>
	</rss>

