Skip to content
This repository was archived by the owner on Aug 7, 2020. It is now read-only.

A PHP plugin to validate all form fields using the bootstrap validator. No need to writing any javascript.

License

Notifications You must be signed in to change notification settings

academicz/php_form_validation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP-Bootstrap Validaton Plugin

A PHP plugin to validate form using the bootstrap validator without writing any javascript.

Installation

Using composer

composer require rahulreghunath/php-rvalidation

Usage

Include

  • Form class
  • jQuery
  • bootstrap js,css
  • bootstrapValidator.min.js
  • bootstrapValidator.min.css

in your page

$obj = new Form;

It uses two functions

    1. validate() to validate a particular field with given validation rules

eg: $obj -> validate(field_name,array("validation rules"));

    validation rules are 
    
            "required" - use if it is a required field
            
            "min"=>"minium length" - to set minium length
            
            "max"=>"maxium length" - to set minium length
            
            "email" - use if it is email field
            
            "mobile" - Indian (10 digit) mobile number ( can be customized )
            
            "pin" - Indian Zip code ( can be customized )
            
            "different"=>"different_field different_field_name"
            
            "identical"=>"identical_field identical_field_name"
            
            "remote"=>"remotelocation"
            
            "regexp"=>"type of field"
            
                type of fields are : text,name,age address,pin,mobile number etc
                
                "rmsg" - used with remote validation to display custom error message if remote 
                validation is failed 

eg: $obj -> validate("password",array("required","label"=>"password","regexp"=>"name"));

    1. applyvalidations() to apply the generated validation rules to the page Only work if bootstrap validater is included in the page.

eg: <script> <?php $obj->applyvalidations("form_id");?> </script>

About

A PHP plugin to validate all form fields using the bootstrap validator. No need to writing any javascript.

Resources

License

Stars

Watchers

Forks

Packages

No packages published