Results 1 to 3 of 3
  1. #1
    Join Date
    Jun 2009
    Location
    Kent, UK
    Posts
    347
    Plugin Contributions
    5

    Default validation / all CAPITALS alert for attributes

    I use my TEXT attributes, which act as the customers personalisation to be engraved on to whatever product they have selected, due to the nature of the products i cannot accept capital letters only lowercase or propercase strings.

    Im looking for a way to ensure that the customer does not enter all capital letters. I also cannot use javascript to automatically force proper or lower caps as there is no way of logically seeing which words should be automatically capitalised ie names etc and which shouldnt ie simple sentences.

    so i need to use validation of some kind to alert the customer that their input is in all caps and needs to be changed in order to be submitted, can anyone point me either to the correct file to edit the validation, a mod which may help or any advice in general

    thanks!

  2. #2
    Join Date
    Jun 2009
    Location
    Kent, UK
    Posts
    347
    Plugin Contributions
    5

    Default Re: validation / all CAPITALS alert for attributes

    ok so ive been trying at this, i only know a little php to keep me going, but im not sure what im meants to be doing at all!?

    ive looked in the includes/functions/functions_lookups.php file and after this section of code
    Code:
    // text required validation
        if (preg_match('/^txt_/', $option)) {
          $check_attributes = $db->Execute("select attributes_display_only, attributes_required from " . TABLE_PRODUCTS_ATTRIBUTES . " where products_id='" . (int)$product_id . "' and options_id='" . (int)preg_replace('/txt_/', '', $option) . "' and options_values_id='0'");
    // text cannot be blank
          if ($check_attributes->fields['attributes_required'] == '1' and empty($value)){
            $check_valid = false;
          }
        }
    
        return $check_valid;
      }
    ive added
    Code:
     //check for caps 
    	if (ctype_upper($option) ==1) {
    		$check_valid = false;
          }
    and it didnt work :/


    after looking it up (for ages lol) im really out of my depth can anyone help?

    all i want is to trigger the alert system already there if the string is caps, i dont want to change i just want to let the customer know?

  3. #3
    Join Date
    Sep 2008
    Location
    DownUnder, overlooking South Pole.
    Posts
    976
    Plugin Contributions
    6

    Default Re: validation / all CAPITALS alert for attributes

    Have you seen this mod?

    http://www.zen-cart.com/index.php?ma...roducts_id=441

    Have you tried strtolower?

    Hope this helps

 

 

Similar Threads

  1. v139h Update attributes for all products?
    By gotyed in forum General Questions
    Replies: 2
    Last Post: 5 Mar 2012, 06:22 PM
  2. Attributes for all products
    By pitkin2020 in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 5 Oct 2011, 01:45 PM
  3. Attributes - Validation
    By alphatrion in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 16 Oct 2008, 05:33 AM
  4. CAPITALS - main page problem
    By Green333 in forum Basic Configuration
    Replies: 4
    Last Post: 15 Aug 2008, 08:55 AM
  5. Download attributes for all categories?
    By DigiDarling in forum Setting Up Categories, Products, Attributes
    Replies: 4
    Last Post: 30 Aug 2007, 10:16 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR