Making required fields not required
#1
Posted 19 February 2004 - 11:18 PM
-jim
#2
Posted 20 February 2004 - 06:25 AM
<?php echo tep_draw_input_field('city', '', 'size="30"') . ' ' . (tep_not_null(ENTRY_CITY_TEXT) ? '<span class="inputRequirement">' . ENTRY_CITY_TEXT . '</span>': ''); ?>
This part of that code:
<span class="inputRequirement">' . ENTRY_CITY_TEXT . '</span>
tells the script to look at this code in /catalog/includes/languages/english.php for the corresponding text. In that file, you'll find:
define('ENTRY_CITY_TEXT', '*');
Changing that code (obviously with all of the fields that you don't want flagged as required -- not just the 'City' example I'm giving) to:
define('ENTRY_CITY_TEXT', ' ');
should remove the 'required' reference from your pages.
HTH,
Terry
Contribs Installed: Purchase Without Account (PWA); Big Images, Product Availability, Description in Product Listing, Graphical Infobox, Header Tags Controller, Login Box, Option Type Feature, plus many layout changes & other mods of my own, like:
Add order total to checkout_shipment
Add order total to checkout_payment
Add radio buttons at checkout_shipping (for backorder options, etc.)
Duplicate Table Rate Shipping Module
Better Product Review Flow
* If at first you don't succeed, find out if there's a prize for the loser. *
#3
Posted 20 February 2004 - 10:57 AM
How to put the telephone number on the e-mail confirmation send to me?
#4
Posted 24 March 2004 - 02:57 PM
TerryK, on Feb 20 2004, 06:25 AM, said:
<?php echo tep_draw_input_field('city', '', 'size="30"') . ' ' . (tep_not_null(ENTRY_CITY_TEXT) ? '<span class="inputRequirement">' . ENTRY_CITY_TEXT . '</span>': ''); ?>
This part of that code:
<span class="inputRequirement">' . ENTRY_CITY_TEXT . '</span>
tells the script to look at this code in /catalog/includes/languages/english.php for the corresponding text. In that file, you'll find:
define('ENTRY_CITY_TEXT', '*');
Changing that code (obviously with all of the fields that you don't want flagged as required -- not just the 'City' example I'm giving) to:
define('ENTRY_CITY_TEXT', ' ');
should remove the 'required' reference from your pages.
HTH,
Terry
I tried it your way and had success in removing the red stars.
But nevertheless, a popup-Window appears.
It insists that the fields must have a certain length, even one of 0!?
Any idea to work around that problem?
Thanks
#5
Posted 28 March 2004 - 02:01 AM
It doesn't tell the script no to require it...
Here is the script;
define('ENTRY_CITY_TEXT', '*');
Any idea on how to make the telephone number not required ?
#6
Posted 28 March 2004 - 02:10 AM
Mike
#7
Posted 28 March 2004 - 05:22 AM
#8
Posted 31 March 2004 - 07:31 AM
also where do I access the customer table to set to null to NO
TIA Doug
#9
Posted 31 March 2004 - 02:58 PM
You find your table (customers) and modify the columns that you want to change to be not null.
i wouldn't advise messing with this unless you know what you are doing though as it can damage your oscommerce system.
i just commented out the gender line so they cant enter a gender. that solves the prob!
#10
Posted 31 March 2004 - 03:07 PM
if (strlen($firstname) < ENTRY_FIRST_NAME_MIN_LENGTH) {
$error = true;
$messageStack->add('create_account', ENTRY_FIRST_NAME_ERROR);
}
This did it for me and it was pretty easy.
By the way, you also have to change account_edit.php the same way. Otherwise, if somebody tries to edit their account settings, they will then be required to submit all the information that you originally made optional.
#11
Posted 13 April 2004 - 06:41 PM
mike s, on Mar 27 2004, 10:10 PM, said:
Mike
I haven't messed with the database, but taking a peek show me that all fields in table "customers" under NULL are set to NO with the exception of
customers_fax
customers_newsletter
which are set to YES.
Quote
I did that too... so now I have no "gender" field on the form, but it still tells me it's required!
Any other ideas?
#12
Posted 13 April 2004 - 06:47 PM
Quote
That means that Allow Nulls is NO for those items. If you want them to be able to leave it blank, set that field to YES for those items.
#13
Posted 13 April 2004 - 06:50 PM
I should note, I'm specifically trying to remove the gender field, and to make date of birth optional.
I removed gender from the form, but it is still trying to validate it. I removed the * from DOB, and it is still trying to validate it.
I understand the * doesn't cause the validation, I'm just trying to be thorough in explaining my issue.
Edited by Sapro, 13 April 2004 - 06:52 PM.
#14
Posted 13 April 2004 - 07:06 PM
If it still does not work, you might just want to remove it completely by going to Admin/Configuration/Customer Details
#15
Posted 13 April 2004 - 07:11 PM
bluepony, on Apr 13 2004, 03:06 PM, said:
I think that was what I was looking for all along! Thanks a bunch!
#16
Posted 24 April 2004 - 04:14 AM
I followed the steps to remove the required field for the phone number and it worked.
However, IE 6 has been generating a syntax error message for line 116, character 28 in catalog/create_account.php.
So, I reinstalled the ORIGINAL files for catalog/create_account.php and it still shows the error message.
Then I reinstalled the original file for catalog/languages/english/create_account.php and it STILL shows the error message AND the missing asterisk after the phone number (which I removed).
Create Account page
Help! What am I missing????
#17
Posted 25 April 2004 - 07:14 AM
For example, you can't set the minimum field to 0 or a non-0 number without generating some type of error.
The best thing to do is to delete the Minimum requirement altogether by deleting all instances of the field from the database and PHP scripts.
There are references to the phone field and most other fields on 11 different pages! Or 7 pages if you only use english.
- account_edit.php - catalog
- create_account.php - catalog
- oscommerce.sql - catalog/install
- form_check.js.php - catalog/includes
- english.php - catalog/languages
- espanol ..
- german ...
- customers.php - catalog/admin
- english.php - catalog/admin/includes/languages
- espanol ..
- german ..
I am going to create a little helpful manual as I go along and will put the link to the guide in my signature file for easy reference.
#18
Posted 21 February 2009 - 08:39 PM
Thanks!
Edited by callenords, 21 February 2009 - 08:40 PM.
#19
Posted 02 April 2012 - 12:01 PM
How do you remove the telephone number from this???
#20
Posted 02 April 2012 - 12:23 PM
The security add-on I did checks a phone number if given, then that it passes set params, if not provided ignored.
Remember, What you think I ment may not be what I thought I ment when I said it.
Contributions:
Auto Backup your Database, Easy way
Multi Images with Fancy Pop-ups, Easy way
Products in columns with multi buy etc etc
Disable any Category or Product, Easy way
Secure & Improve your account pages et al.









