initial commit
This commit is contained in:
31
public/js/js.input.validation.js
vendored
Normal file
31
public/js/js.input.validation.js
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
|
||||
function onlyInteger(elem) {
|
||||
|
||||
var result = true;
|
||||
var value = event.which;
|
||||
|
||||
if (value < 48 || value > 57) {
|
||||
result = false;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
function imageShow(element,img){
|
||||
var file = event.target.files[0];
|
||||
if(file.type.match(/image.*/)) {
|
||||
var imgInp = element;
|
||||
var blah = document.getElementById(img);
|
||||
const [file] = imgInp.files
|
||||
if (file) {
|
||||
blah.src = URL.createObjectURL(file)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user