This topic is locked

Php Ruhner Field Validation

1/15/2013 2:59:23 PM
PHPRunner General questions
H
holdenslx author

I'm new to all this and have tried entering validation into my form unsuccessfully.
I have a field in my form which is essentially a flight number and I need to have it validated to stop incorrect data being entered. The field must be entered using a combination of alpha and numeric characters.
Example: TCH1401, QF201, BA415 ANA2315.
What I am trying to stop being entered is any of the following characters being entered as part of the data as this is incorrect and requires editing and correcting:
Non allowed characters, / : \
TCH (Without proceeding numeric values)or any Alpha combination without numeric values
1111 (Numeric values entered that don't start with alpha)
If anyone can assist me with this I would really appreciate it, I read the help notes on validation unfortunately that didn't help and just made it more difficult to understand, as it only deals with generic scenario.
Cheers

Peter

Sergey Kornilov admin 1/15/2013

PHPRunner provides four ways to validate input.

  1. Validate as: Regular expression

    http://xlinesoft.com/phprunner/docs/validation_types.htm#standard_validation_types
    Regular expressions syntax might be tough but there is a huge number of examples on the Internet for each possible task
  2. Input mask

    Settings input mask is also a valid way to prevent incorrect data from being entered. Syntax is easier to grasp than regular expressions.

    http://xlinesoft.com/phprunner/docs/edit_as_settings_text_field.htm
  3. Custom validation plugin

    http://xlinesoft.com/phprunner/docs/validation_types.htm#own_validation_type
    Requires a bit of javascript knowledge and works the best when a bit of algorithmic validation is required i.e. credit card number validation.
  4. BeforeAdd/BeforeEdit events

    The difference is that is validation happens on the server side and page will be reloaded. Makes sense to use it when enetered data needs to be checked against your database.

    http://xlinesoft.com/phprunner/docs/before_record_added.htm