![]() |
Required fields
Please could someone tell me how to remove/edit the required field tabs in contact us also in checkout,
Many Thanks :D |
I am wondering the same thing.
Seems silly to require people to enter their address just to ask you a question (and then to make it even more futile it doesn't even register them as a user). I would just dump it and make my own contact page, but I like people being able to enter that info, just not being required to. |
This was easier than I thought once I found the right file. The contact mail sending is done by include/help.php. All you must do to make options not required is change code:
Code:
$fillerror = (empty($contact["firstname"]) || empty($contact["lastname"]) || empty($contact["b_address"]) || empty($contact["b_city"]) || empty($contact["b_country"]) || empty($contact["b_zipcode"]) || empty($contact["phone"]) || empty($contact["email"]) || empty($contact["subject"]) || empty($contact["body"])); to: Code:
$fillerror = (empty($contact["firstname"]) || empty($contact["lastname"]) || empty($contact["email"]) || empty($contact["body"])); Now no address info is required. Emails go thru perfectly they just dont have any information in the fields that are not filled out that are no longer required. Hope that is what you were looking for. |
Where is the include file?
How can I find the file: include/help.php ?
|
ftp into your server and look through the files
|
Easier way to remove required fields in contact form
The way to remove required fields from the contact form is to edit the include/help.php file and the skin1/help/contact.tpl file as mentioned in the previous posts.
However, I didn't want to edit the PHP file for fear of upgrade issues/headaches in the future. My method is to do this by adding some Javascript to the contact.tpl file. The idea is this: 1) remove the asterisks of the fields you don't want required anymore 2) add our own javascript validation function that denies submission of the form if our required fields are not filled in 3) in that same validation function, set the fields that we no longer want required to a non-empty string if the user did not fill it out. The javascript function looks like this: Code:
function formSubmit(thisform) We have to change our submit button to call that validation function from: to My complete contact.tpl file looks like this. Code:
{* $Id: contactus.tpl,v 1.17.2.1 2003/02/11 09:03:02 svowl Exp $ *} Fun, eh? Gary |
cool scripting
Hey Gary,
looks cool... Does this method kinda bypass the required fields in the help.php file? Will this work if I want to remove some of the fields in the contact.tpl file? or do all the fields have to stay there if u want it to work? thanks, Ben |
Re: cool scripting
Quote:
Kind of... instead of BYPASSING the idea is to go AROUND the required fields in help.php by using JS to set the ones we DON'T want to be required to a non-empty string. If you want to remove a couple of fields (even the required ones), all you have to do is change them from text fields to hidden input fields. Gary |
From what I have read, all these mod are about removing some unwanted fields in the contact us form, How do I add some fields if I want to use this contact us form for music student application form, I need the student to enter what time they want to book, what class, etc
|
This is a very old thread. In version 4, you can just go to General Settings/Contact Us Options and add as many extra fields as you want by using the dialog at the bottom. Same goes for the registration forms.
|
Thanks balinor for pointing out, I should have played more on the backend, well if I want to have more than one of those contact us form let say I want one for contact us for general enquire, and one for registration form, Do you think I can do that? My understanding is I only have one contach us form, I can customize it according to what you pointed out, once customized, it is done, I can't have a similar form with diffrenet fields, am I right? I still think I can have more than one of those forms which can be fully customized to my needs, maybe by modify the code
|
There are already two seperate forms for this. One for registration and one for Contact Us. You can add or subtract as many fields as you want from both of these forms.
|
I find that registration form is shared between adminstrator and customer profile creation, I am better off leave registration form alone, I would like to leave resitration form as the way it is now for my customer to register, so it only leave me with one form can customize, I am wondering whether I can modify the code to create some other form to customize at will, that will be really nice
|
You also have the ability to specify which fields appear for which type of customer/administrator.
|
Thanks, So you think there is no need to mod the code to create some new forms, actually that will be really nice if I know how to create a new page form, How hard would that be?
|
All times are GMT -8. The time now is 04:27 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.