ht5ifv - extension Module

A non-exhaustive set of potentially useful ht5ifv extensions

What it is

Is set of (maybe) useful ht5ifv extensions which could be used as new input types or as a new restrictions
It implements the following extensions The XX is the Country Code for each of each of 54 adherent Countries. See the table in IBAN Regular Expression Patterns tool

How to use it

In javascript you shoud include theses files first
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" 
type="text/javascript" charset="UTF-8"></script>

<link rel="stylesheet" type="text/css" media="screen" href="http://serprest.pt/jquery/ht5ifv.css"/>
<script type="text/javascript" src="http://serprest.pt/jquery/jquery.ht5ifv.js" charset="UTF-8"></script>
<script type="text/javascript" src="http://serprest.pt/jquery/extensions/ht5ifv.ext.js" charset="UTF-8"></script>
				
And then, and before applying ht5ifv validation, you must indicate the extensions that intend to use.
	
<script type="text/javascript" charset="UTF-8">       
	$(document).ready(function(){
		$.ht5ifv('use'); //use ALL types/restrictions 
		$('form').ht5ifv();
	});
</script>
				
Finally, in HTML, you can use them as new types, for example:
	
<div>
	<label for="isbn">ISBN:</label>
	<input type="ISBN" class="ui-corner-all" name="isbn" id="isbn" />
	<span>Type: ISBN</span>
</div>
			
Or you may use them as new data-XXX restrictions
	
<div>
	<label for="isbn">ISBN:</label>
	<input type="text" data-ISBN="1" class="ui-corner-all" name="isbn" id="isbn"/>
	<span>Type: text but use data-ISBN restriction</span>
</div>
			

More usage options

Currently this module provides support for 126 types and 126 extensions (18 + 54 * IBAN-XX + 54 * BBAN-XX). This could lead to a waste of resource consuming. If you just want a few of them, you may list those in one array and pass it as an argument when invoke the static 'use' method
<script type="text/javascript" charset="UTF-8">       
	$(document).ready(function(){
		$.ht5ifv('use',['ISBN','VAT']); //only use VAT and ISBN types/restrictions 
		$('form').ht5ifv();
	});
</script>
			
The above code only installs code for handling two new types (ISBN and VAT) and two new extensions (data-ISBN and data-VAT). You could also limit it to be only installed as a type or as a restriction. At same time you may also change the (type/restriction) name
<script type="text/javascript" charset="UTF-8">       
	$(document).ready(function(){
		$.ht5ifv('use',[
			['_ISBN','type','tISBN'],		//install type ISBN under the name tISBN
			['_VAT','restriction','tVAT']	//install restriction VAT under the name rVAT
		]);  
		$('form').ht5ifv();
	});
</script>
			

What more

This is not a closed list (and never will be). See the source code if you need to change some validatons rules or add/delete some of them.
The sources of information is indicated in the source code, case by case.
All the IBAB/BBAN patterns have been generated automatically by IBAN Regular Expression Patterns tool ( http://serprest.pt/jquery/ht5ifv/extensions/tools/IBAN/index.html). You may check it if you want to have different validation rules (ex: don't allow empty spaces, dashes ou dots between between digit groups).

How validation is made

  • iTelNumber: A RE pattern
  • US-PN: A RE pattern
  • PT-PN: A RE pattern
  • creditCard: A RE pattern and a Checksum
  • ISBN: A RE pattern and a Checksum
  • VAT: A RE pattern
  • US-PC: A RE pattern
  • CA-PC: A RE pattern
  • PT-PC: A RE pattern
  • DE-PC: A RE pattern
  • UK-PC: A RE pattern
  • US-SSN: A RE pattern
  • IP: A RE pattern
  • PT-BI: A RE pattern and a Checksum
  • PT-NIF: A RE pattern and a Checksum
  • PT-NIB: A RE pattern and a Checksum
  • IBAN: A RE pattern and a Checksum
  • BBAN: A RE pattern and a Checksum
  • IBAN-XX: A RE pattern and a Checksum
  • BBAN-XX: A RE pattern and a Checksum