Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2005
    Location
    United Kingdom
    Posts
    44
    Plugin Contributions
    0

    help question Make company field as required.

    Hi,

    I tried to change the company field as required. I changed the code in includes/modules/pages/create_account/header_php.php from:
    if (ACCOUNT_COMPANY == 'true') $company = zen_db_prepare_input($_POST['company']);

    TO:
    if (ACCOUNT_COMPANY == 'true') {
    $company = zen_db_prepare_input($_POST['company']);
    if (strlen($company) < 3) {
    $error = true;
    $messageStack->add('create_account', ENTRY_COMPANY_NAME_ERROR);
    }
    }

    However, people still can submit the form without filling the company field. I also changed the minimum value in admin section from 0 to 3.
    Can anybody help me to point out why this doesn't work? Am I missing something?

    Thanks a lot!!

  2. #2
    Join Date
    Mar 2005
    Location
    United Kingdom
    Posts
    44
    Plugin Contributions
    0

    Default Re: Make company field as required.

    I found the solution by myself. For those who have the same difficulty, go to includes/modules/pages/create_account/jscript_form_check.php and you can add the php check for ACCOUNT_COMPANY under function check_form(form_name) {} .

    This will fix the problem. :)

  3. #3
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Make company field as required.

    Thanks for the update on how you addressed this change ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  4. #4
    Join Date
    Aug 2007
    Posts
    1
    Plugin Contributions
    0

    Default Re: Make company field as required.

    I also wish to make the company name a required field. I'm confused with this solution though. I don't know php so I'm not sure exactly what was done here to make it work. Here is what I -have- done:

    - edited english.php to make the * visible
    - gave a minimum value to company name of 1 (which appears to have made it required on account creation0

    But now here is my problem.
    If a person then goes to edit their address details, the Company name is still listed as a required field but is no longer filled in with any info. The name, address and other fields are populated, but the company name is not. If the user clicks to update, then the company name disappears.

    So my problem is, Company name is being required on account creation, but on address update it is blanking the field and not actually requiring it. Seems like a bug to me. What am I missing?

    Thanks,
    Asa Jay

 

 

Similar Threads

  1. Making Company Field on Create Account Required
    By pioupioun in forum Templates, Stylesheets, Page Layout
    Replies: 9
    Last Post: 21 Oct 2010, 04:31 PM
  2. How to make "Company Name" a required field?
    By hllight in forum General Questions
    Replies: 4
    Last Post: 15 Feb 2009, 04:26 PM
  3. I need to make the "company" field a required field
    By semaxd in forum Managing Customers and Orders
    Replies: 2
    Last Post: 30 Jun 2008, 09:09 PM
  4. Company Field in Contact Us Form Required?
    By Qoffa in forum General Questions
    Replies: 9
    Last Post: 5 Jul 2007, 06:49 AM
  5. Company Name is Required field?!?!
    By wickedklown in forum General Questions
    Replies: 10
    Last Post: 1 Feb 2007, 02:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg