File: assets/appjs/import.js

Recommend this page to a friend!
  Classes of Kishor Mali  >  PHP User Feedback System  >  assets/appjs/import.js  >  Download  
File: assets/appjs/import.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: PHP User Feedback System
Application to record feedback from customers
Author: By
Last change:
Date: 4 months ago
Size: 1,176 bytes
 

Contents

Class file image Download
/**
 * File : import.js 
 * 
 * This file contain the validation of edit user form
 * 
 * @author Kishor Mali
 */
$(document).ready(function(){
	
	var importExcel = $("#importExcel");

	var importExcelValidator = importExcel.validate({
		
		rules:{
			impfile :{ required : true, extension : "xls|xlsx" }

		},
		messages:{
			impfile :{ required : "You must select a file to upload", extension : "Select files with extension xls and xlsx only"}
		}
	});
	
	
	$("#noOfRecords").keydown(function (e) {
        // Allow: backspace, delete, tab, escape, enter and .
        if ($.inArray(e.keyCode, [46, 8, 9, 27, 13, 110, 190]) !== -1 ||
             // Allow: Ctrl+A, Command+A
            (e.keyCode == 65 && ( e.ctrlKey === true || e.metaKey === true ) ) || 
             // Allow: home, end, left, right, down, up
            (e.keyCode >= 35 && e.keyCode <= 40)) {
                 // let it happen, don't do anything
                 return;
        }
        // Ensure that it is a number and stop the keypress
        if ((e.shiftKey || (e.keyCode < 48 || e.keyCode > 57)) && (e.keyCode < 96 || e.keyCode > 105)) {
            e.preventDefault();
        }
    });
	
});

For more information send a message to info at phpclasses dot org.