js verificación fraccional (coma flotante) y el tipo de número entero

// parámetro 19

si (IsHaveRole ( "IE")) {
return "<input id = 'Tpm_Target_Machine_Ct" + row.ID + " 'tipo = 'texto' class = 'haverole' onchange = 'isfloat (este)' value ='" + ( row.TPM_TARGET_MACHINE_CT) + "'/>";
}
Else {
retorno "<input id = 'Tpm_Target_Machine_Ct" + row.ID + " 'tipo = 'texto' = discapacidad discapacitados 'class = 'notrole' onchange = 'isfloat (este)' value ='" + (fila. TPM_TARGET_MACHINE_CT) + "'/>";
}

 

/ **
únicamente numérico y punto decimal
* /
función isfloat (obj) {

= Obj.valu tenerlo;

si (Onum!) return false;

era STRP = /^\d+(\.\d+)?$/;

si (strP.test (Onum)!)
{
obj.value = "";
return false
};

tratar {

si (parseFloat (Onum) = Onum!)
{
obj.value = "";
return false
};

} Catch (ex) {
obj.value = "";
falso retorno;

}

return true;

}

/ ** ** verificar entero positivo /

función ISNUMBER (obj) {

= Obj.valu tenerlo;

si (Onum!)
{
obj.value = "";
falso retorno;
}

var STRP = / ^ \ d + $ /; // número entero positivo

si (strP.test (Onum)!)
{
obj.value = "";
falso retorno;
}

return true;

}

Supongo que te gusta

Origin www.cnblogs.com/hanzonghao/p/12587706.html
Recomendado
Clasificación