<?php
/*
* AJAX Validation script
*
* Copyright(c) 2010, Thomas Shone
* http://www.shone.co.za
*
* This file contains all the ajax validation types.
*
* @param string type The type of validation required
* @param string id The id field (where applicable)
* @param mixed value The value of the field
*/
switch ($_REQUEST['type'])
{
case 'postal_code':
if ($_REQUEST['value'] < 35004 || $_REQUEST['value'] > 83127)
{
$aResult = array(
'result' => false,
'message' => array(
'This is an invalid postal code'
)
);
}
else
{
$aResult = array(
'result' => true,
);
}
echo json_encode($aResult);
break;
}