jQuery(function ($) {
$(function () {
$('#ctl00_MainContent_fuUploadImage1').on("change", function () {
var files = !!this.files ? this.files : [];
if (!files.length || !window.FileReader) return; // no file selected, or no FileReader support
if (/^image/.test(files[0].type)) { // only image file
var reader = new FileReader(); // instance of the FileReader
reader.readAsDataURL(files[0]); // read the local file
reader.onloadend = function () { // set image data as background of div
$('#ctl00_MainContent_UploadImage1').attr('src', this.result);
}
}
});
$('#ctl00_MainContent_FileUploadImage2').on("change", function () {
var files = !!this.files ? this.files : [];
if (!files.length || !window.FileReader) return; // no file selected, or no FileReader support
if (/^image/.test(files[0].type)) { // only image file
var reader = new FileReader(); // instance of the FileReader
reader.readAsDataURL(files[0]); // read the local file
reader.onloadend = function () { // set image data as background of div
$('#ctl00_MainContent_UploadImage2').attr('src', this.result);
}
}
});
$('#onlineregistration-amount').change(function(){
if(Number($(this).val()) == 0){
alert("Amount value is Greater than 0. Please Enter valid Amount.");
document.getElementById('onlineregistration-amount').value = "";
return false;
}
});
});
var $el=jQuery("#form-contact .kv-hint-special");if($el.length){$el.each(function(){$(this).activeFieldHint()});}
jQuery('#form-contact').yiiActiveForm([{"id":"onlineregistration-name","name":"name","container":".field-onlineregistration-name","input":"#onlineregistration-name","validate":function (attribute, value, messages, deferred, $form) {yii.validation.required(value, messages, {"message":"Candidate Name cannot be blank."});yii.validation.string(value, messages, {"message":"Candidate Name must be a string.","max":100,"tooLong":"Candidate Name should contain at most 100 characters.","skipOnEmpty":1});}},{"id":"onlineregistration-date_of_birth","name":"date_of_birth","container":".field-ctl00_MainContent_ucDOB_txt_Date","input":"#ctl00_MainContent_ucDOB_txt_Date","validate":function (attribute, value, messages, deferred, $form) {yii.validation.required(value, messages, {"message":"Date of Birth cannot be blank."});}},{"id":"onlineregistration-gender","name":"gender","container":".field-onlineregistration-gender","input":"#onlineregistration-gender","validate":function (attribute, value, messages, deferred, $form) {yii.validation.required(value, messages, {"message":"Gender cannot be blank."});}},{"id":"onlineregistration-category","name":"category","container":".field-onlineregistration-category","input":"#onlineregistration-category","validate":function (attribute, value, messages, deferred, $form) {yii.validation.required(value, messages, {"message":"Category cannot be blank."});}},{"id":"onlineregistration-email","name":"email","container":".field-onlineregistration-email","input":"#onlineregistration-email","validate":function (attribute, value, messages, deferred, $form) {yii.validation.required(value, messages, {"message":"Email ID cannot be blank."});yii.validation.string(value, messages, {"message":"Email ID must be a string.","max":50,"tooLong":"Email ID should contain at most 50 characters.","skipOnEmpty":1});yii.validation.email(value, messages, {"pattern":/^[a-zA-Z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+\/=?^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?$/,"fullPattern":/^[^@]*<[a-zA-Z0-9!#$%&'*+\/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+\/=?^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?>$/,"allowName":false,"message":"Email ID is not a valid email address.","enableIDN":false,"skipOnEmpty":1});}},{"id":"onlineregistration-mobile","name":"mobile","container":".field-onlineregistration-mobile","input":"#onlineregistration-mobile","validate":function (attribute, value, messages, deferred, $form) {yii.validation.required(value, messages, {"message":"Mobile No. cannot be blank."});yii.validation.string(value, messages, {"message":"Mobile No. must be a string.","max":10,"tooLong":"Mobile No. should contain at most 10 characters.","skipOnEmpty":1});}},{"id":"onlineregistration-father_name","name":"father_name","container":".field-onlineregistration-father_name","input":"#onlineregistration-father_name","validate":function (attribute, value, messages, deferred, $form) {yii.validation.required(value, messages, {"message":"Father's Name cannot be blank."});}},{"id":"onlineregistration-father_occupation","name":"father_occupation","container":".field-onlineregistration-father_occupation","input":"#onlineregistration-father_occupation","validate":function (attribute, value, messages, deferred, $form) {yii.validation.required(value, messages, {"message":"Occupation cannot be blank."});}},{"id":"onlineregistration-father_mobile_no","name":"father_mobile_no","container":".field-onlineregistration-father_mobile_no","input":"#onlineregistration-father_mobile_no","validate":function (attribute, value, messages, deferred, $form) {yii.validation.required(value, messages, {"message":"Mobile No. cannot be blank."});}},{"id":"onlineregistration-address1","name":"address1","container":".field-onlineregistration-address1","input":"#onlineregistration-address1","validate":function (attribute, value, messages, deferred, $form) {yii.validation.required(value, messages, {"message":"Line 1 cannot be blank."});}},{"id":"onlineregistration-city_town","name":"city_town","container":".field-onlineregistration-city_town","input":"#onlineregistration-city_town","validate":function (attribute, value, messages, deferred, $form) {yii.validation.required(value, messages, {"message":"City/Town cannot be blank."});}},{"id":"onlineregistration-state_name","name":"state_name","container":".field-onlineregistration-state_name","input":"#onlineregistration-state_name","validate":function (attribute, value, messages, deferred, $form) {yii.validation.required(value, messages, {"message":"State cannot be blank."});}},{"id":"onlineregistration-pincode","name":"pincode","container":".field-onlineregistration-pincode","input":"#onlineregistration-pincode","validate":function (attribute, value, messages, deferred, $form) {yii.validation.required(value, messages, {"message":"Pincode cannot be blank."});yii.validation.number(value, messages, {"pattern":/^\s*[+-]?\d+\s*$/,"message":"Pincode must be an integer.","skipOnEmpty":1});}},{"id":"onlineregistration-session","name":"session","container":".field-onlineregistration-session","input":"#onlineregistration-session","validate":function (attribute, value, messages, deferred, $form) {yii.validation.required(value, messages, {"message":"Session cannot be blank."});}},{"id":"onlineregistration-center_name","name":"center_name","container":".field-onlineregistration-center_name","input":"#onlineregistration-center_name","validate":function (attribute, value, messages, deferred, $form) {yii.validation.required(value, messages, {"message":"Center Name cannot be blank."});}},{"id":"onlineregistration-course","name":"course","container":".field-onlineregistration-course","input":"#onlineregistration-course","validate":function (attribute, value, messages, deferred, $form) {yii.validation.required(value, messages, {"message":"Course cannot be blank."});}},{"id":"onlineregistration-batch_type","name":"batch_type","container":".field-onlineregistration-batch_type","input":"#onlineregistration-batch_type","validate":function (attribute, value, messages, deferred, $form) {yii.validation.required(value, messages, {"message":"Batch Type cannot be blank."});}},{"id":"onlineregistration-batch","name":"batch","container":".field-onlineregistration-batch","input":"#onlineregistration-batch","validate":function (attribute, value, messages, deferred, $form) {yii.validation.required(value, messages, {"message":"Batch cannot be blank."});}},{"id":"onlineregistration-amount","name":"amount","container":".field-onlineregistration-amount","input":"#onlineregistration-amount","validate":function (attribute, value, messages, deferred, $form) {yii.validation.required(value, messages, {"message":"Amount cannot be blank."});yii.validation.number(value, messages, {"pattern":/^\s*[+-]?\d+\s*$/,"message":"Amount must be an integer.","skipOnEmpty":1});yii.validation.number(value, messages, {"pattern":/^\s*[+-]?\d+\s*$/,"message":"Amount must be an integer.","min":4999,"tooSmall":"Amount must be no less than 4999.","skipOnEmpty":1});}},{"id":"onlineregistration-profile_photo","name":"profile_photo","container":".field-ctl00_MainContent_fuUploadImage1","input":"#ctl00_MainContent_fuUploadImage1","validate":function (attribute, value, messages, deferred, $form) {yii.validation.required(value, messages, {"message":"Upload Photo cannot be blank."});}},{"id":"onlineregistration-signature","name":"signature","container":".field-ctl00_MainContent_FileUploadImage2","input":"#ctl00_MainContent_FileUploadImage2","validate":function (attribute, value, messages, deferred, $form) {yii.validation.required(value, messages, {"message":"Upload Signature cannot be blank."});}},{"id":"onlineregistration-id_proof","name":"id_proof","container":".field-onlineregistration-id_proof","input":"#onlineregistration-id_proof","validate":function (attribute, value, messages, deferred, $form) {yii.validation.required(value, messages, {"message":"Upload ID Proof Front cannot be blank."});}},{"id":"onlineregistration-marksheet_certificate","name":"marksheet_certificate","container":".field-onlineregistration-marksheet_certificate","input":"#onlineregistration-marksheet_certificate","validate":function (attribute, value, messages, deferred, $form) {yii.validation.required(value, messages, {"message":"10th Marksheet/Certificate cannot be blank."});}},{"id":"onlineregistration-acordul_tc","name":"acordul_tc","container":".field-onlineregistration-acordul_tc","input":"#onlineregistration-acordul_tc","validate":function (attribute, value, messages, deferred, $form) {yii.validation.required(value, messages, {"message":"I Agree Terms and Conditions cannot be blank."});yii.validation.number(value, messages, {"pattern":/^\s*[+-]?\d+\s*$/,"message":"I Agree Terms and Conditions must be an integer.","skipOnEmpty":1});yii.validation.compare(value, messages, {"operator":"==","type":"string","compareValue":true,"skipOnEmpty":1,"message":"I Agree Terms and Conditions must be equal to \"1\"."}, $form);}}], []);
});