Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: form field validation (numeric or empty only)

    Quote Originally Posted by Veronika7747 View Post
    and the screen is still blank!!
    https://www.zen-cart.com/tutorials/index.php?article=82
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  2. #2
    Join Date
    Nov 2007
    Posts
    270
    Plugin Contributions
    0

    Default Re: form field validation (numeric or empty only)

    But I keep restoring the 2 original files after I make a mess... and it still does not work as before my mistakes. That's the part I cannot understand..

  3. #3
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: form field validation (numeric or empty only)

    Im writing a validation class for ZC, (already finished but havent posted yet) you can have a look if you want.

    https://svn.rubikintegration.com/zen...validation.php
    For example, to check if the customers_email_address passed in POST is not empty and is valid email:
    PHP Code:
    $yvalidation = new yvalidation();
    $rules = array('customers_email_address' => array(array('validation_is_not_empty'=>''),
                                             array(
    'validation_is_email'=>'')));
    $yvalidation->set_params($_POST);
    $yvalidation->set_rules($rules);
    $error_counter $yvalidation->run(); // store the number of errors here 


    Multiple fields can be checked at once, each field can be checked against multiple rules.
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

  4. #4
    Join Date
    Nov 2007
    Posts
    270
    Plugin Contributions
    0

    Default Re: form field validation (numeric or empty only)

    Quote Originally Posted by yellow1912 View Post
    Im writing a validation class for ZC, (already finished but havent posted yet) you can have a look if you want.

    https://svn.rubikintegration.com/zen...validation.php
    For example, to check if the customers_email_address passed in POST is not empty and is valid email:
    PHP Code:
    $yvalidation = new yvalidation();
    $rules = array('customers_email_address' => array(array('validation_is_not_empty'=>''),
                                             array(
    'validation_is_email'=>'')));
    $yvalidation->set_params($_POST);
    $yvalidation->set_rules($rules);
    $error_counter $yvalidation->run(); // store the number of errors here 

    Multiple fields can be checked at once, each field can be checked against multiple rules.
    Thanks, I will take a look..
    for now I just did as follows (and it works for me):
    Code:
          
     if(ereg('^[\s0-9]*$', $a-item1) === false){
        $error = true;
        $messageStack->add('silentauction', 'Leave empty, or enter only numbers (dollar amount, no cents) in your bid input box 1!)');
     }
    if ($a-item1!='' && $a-item1<= 600){
      $error = true;
      $messageStack->add('silentauction', 'Your bid for Fall Buck is equal or bellow the reseved bid of $600!)');
    }

  5. #5
    Join Date
    Oct 2006
    Posts
    5,477
    Plugin Contributions
    11

    Default Re: form field validation (numeric or empty only)

    Yeah, just do whatever works for you ^^.
    I no longer provide installation support on forum for all my modules. However, if there are real bugs with the modules please feel free to contact me

 

 

Similar Threads

  1. form validation - email address field
    By kwright in forum General Questions
    Replies: 1
    Last Post: 18 Sep 2010, 01:52 AM
  2. Custom Form Field and Email Validation
    By zepher in forum Managing Customers and Orders
    Replies: 4
    Last Post: 26 Jan 2010, 12:45 AM
  3. how to increase admin invoice address numeric field?
    By guitarmong in forum General Questions
    Replies: 0
    Last Post: 18 Dec 2009, 02:55 AM
  4. Custom form: Field Validation
    By amites in forum General Questions
    Replies: 3
    Last Post: 8 Jun 2007, 02:37 PM

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