i dont get your issue very well
but from what i got you need to make sure that the last field, that is 'rollnumid' is always a numeric value

JS level check

use this function to check whether it is a number

function isNumeric(n){
    if(!isNaN(n) && typeof(n)=='number'){
        return true;
       return false;

PHP level check
simply use the is_numeric method

PHP Code: