Shopping Cart Software

 
   
Sales and Tech Support (800) 828.6650  

Go Back   3dCart Shopping Cart Software Forums > Shopping Cart Software > General Configuration Questions

Reply
 
Thread Tools Display Modes
  #1 ()  
Old 08-28-2009, 01:22 AM
maksum maksum is offline
3dCart Power User
 
Join Date: Aug 2009
Posts: 249
Default Can I NOT require specific fields in the contact form?

Can I NOT require specific fields in the contact form?

For example, if someone want to just shoot us a quick email, I see no reason to require a telephone number. I want to not appear so invasive in asking for information that could very well not even be needed.

(see attachment)

Thanks for your help.

Mike
Attached Images
File Type: jpg 3dc_phone_req.jpg (9.5 KB, 16 views)
Reply With Quote
  #2 ()  
Old 08-30-2009, 03:47 AM
maksum maksum is offline
3dCart Power User
 
Join Date: Aug 2009
Posts: 249
Default

Wow, this forum is hopping! I'll answer my own question.

I got a response from submitting a ticket that provided a solution. I thought I'd share here in case someone else would like to do this, as it seems like it could be a fairly common request.

Basically you want to edit contact_us.html (via ftp or through the back-end... whichever you prefer.)

Look for this section of javascript toward the beginning of the file:
Quote:
var strMsg = "";
if (document.frmForm.customer.value.trim() == "")
strMsg += " - [crm_name] cannot be blank.\n"
if (document.frmForm.phone.value.trim() == "")
strMsg += " - [crm_phone] cannot be blank.\n"
if (document.frmForm.custemail.value.trim() == "" || !isValidEmail(document.frmForm.custemail.value))
strMsg += " - [crm_email] cannot be blank and must be a valid email address.\n"
if (document.frmForm.subject.value.trim() == "")
strMsg += " - [crm_subject] cannot be blank.\n"
if (document.frmForm.reply.value.trim() == "")
strMsg += " - [crm_message] cannot be blank.\n"
if (document.frmForm.ramdomWord.value.trim() == "")
strMsg += " - Verification word cannot be blank.\n"
Basically to functionally make one of the fields NOT required, just find the appropriate line (2 lines actually, as it is rendered here) and delete it. In my case I did not want to have the phone number required so I removed this:
Quote:
if (document.frmForm.phone.value.trim() == "")
strMsg += " - [crm_phone] cannot be blank.\n"
Next you'll want to visually make this field NOT required. Simply scroll down to where these fields are actually rendered and find the field you're interested in altering. In my case it was phone number and looked like this:
Quote:
<td nowrap="nowrap"><input type="text" name="phone" value="[phone]" size="40" maxlength="50" class="txtBoxStyle">
<img src="assets/templates/common/images/error2.gif" width="12" height="12"> </td>
Simply remove the "required" image so it will look like this:
Quote:
<td nowrap="nowrap"><input type="text" name="phone" value="[phone]" size="40" maxlength="50" class="txtBoxStyle"></td>
That's it.

Have fun.
Reply With Quote
  #3 ()  
Old 08-30-2009, 10:01 AM
Mark Mark is offline
3dCart Geek
 
Join Date: Sep 2007
Posts: 1,310
Default

We also use a similar technique to change the length of the fields. In similar areas of code for other forms, we need to change the max length for input. For example, our credit card processors has a max length for address and zip code that is smaller than what the cart is setup for. As a result, some customers could not check out when using a nine digit zip or 35 character address (our processor had a max of 5 for zip and 25 for address). So, we modified the max lengths for input to match our credit card processors requirements. Also, the returned message for over typing also would report the correct error in max length. HTH
Reply With Quote
  #4 ()  
Old 09-07-2009, 08:12 PM
maksum maksum is offline
3dCart Power User
 
Join Date: Aug 2009
Posts: 249
Default

Ok, so I discovered a little problem with this...

When you (as store owner) receive the message through your CRM, and you try to respond, it will NOT let you reply to a customer without a phone number. You try to enter something yourself, and it won't let you. This is kind of lame, and hopefully someone (at 3dcart) reads this and fixes it, otherwise you just have to NOT use the CRM interface and email them manually...

I was not willing to make my customers place a phone number (if someone wants to ask me when something will be in stock, or how soon I can get something to Oklahoma I don't need them to provide their phone number!) So I did some further tweaking on my contact_us.html page to make it so the field will be populated with something before it sends to me, yet they are required to do nothing. Fortunately I can get away with this because that field does not validate. Just checks to see if it's populated.

First off here is the code (around line 142 depending on tweaks you've made):
Code:
<input type="text" name="phone" value="optional" size="40" maxlength="50" class="txtBoxStyle" onClick="this.value='';" onBlur="if (this.value==''){this.value='optional';}">
So you get to the form and the phone field is already populated with "optional". If the customer wants us to call them they're free to put their phone number in there. They click in there and it deletes "optional" automatically so they can simply start typing. If they click OFF of that field with their phone number (or anything else) in there, they're good to go. If they leave it blank then the word "optional" pops back in there.

So the form will send with something in that field, the customer doesn't feel like I'm being overly inquisitive in asking for their information, and your CRM entry will allow you to respond to them through the system (and thus track the dialog).

Voila!
Reply With Quote
  #5 ()  
Old 09-07-2009, 08:21 PM
Mark Mark is offline
3dCart Geek
 
Join Date: Sep 2007
Posts: 1,310
Default

Thanks for the tip!
Reply With Quote
  #6 ()  
Old 09-08-2009, 04:35 PM
WoodSprite WoodSprite is offline
3dCart Power User
 
Join Date: Mar 2006
Posts: 112
Default

Thank you to both of you for the information and for posting it for all of us.
Reply With Quote
  #7 ()  
Old 03-14-2010, 12:10 PM
flash flash is offline
3dCart Newbie
 
Join Date: Oct 2009
Posts: 4
Default

Thank you for the detailed information. I just finished following your instructions and it worked like a charm. Hopefully the next version will allow us to choose which fields are required in an easier manner.
Reply With Quote
  #8 ()  
Old 03-15-2010, 10:06 PM
yourcablestore.com yourcablestore.com is offline
3dCart User
 
Join Date: Feb 2007
Location: Paradise, CA
Posts: 87
Default

This is kind of lame, and hopefully someone (at 3dcart) reads this and fixes it, otherwise you just have to NOT use the CRM interface and email them manually...

Whenever you run into a problem like this you should submit a support ticket. Although 3dcart staff reads these forums generally the only way things get fixed / changed or otherwise on their radar is through support tickets.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 06:42 PM.

Powered by vBulletin® Version 3.6.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8
Starter Package Basic Package Standard Package Standard Plus Package Power Plan Package