Accept all data type

0

Good afternoon,

I have this function in JS that accepts for example 1234, but I want it to also accept 12:34 (time format). I suspect that the problem is in parseInt, that is, instead of being parseInt (txtValue ...) happens to be parseString (), so I am missing something. : S

function BtnSaveParametrizacaoTempos_Validate() {
  var erro = 0;
  var txtValueObj = $("#<%=txtValue.TextBoxClientID%>");            

  if (txtValueObj.val().trim() === ("" + parseInt(txtValueObj.val(), 10))) { 

    ITCore.Presentation.InsertValidateMsg($("#<%= txtValue.TextBoxClientID%>"), ""); 
    erro = 0; 

  } else { 

    ITCore.Presentation.InsertValidateMsg(
      $("#<%= txtValue.TextBoxClientID%>"), 
      "<%=ITCore.Common.Resources.Translate.GetTransactionString("ParametrizacaoTempos", "InvalidValue")%>"
    ); 

    erro = 1; 
  }

  ResizeIFrame();
  return erro === 0;

}

From what I've seen on bd, it has a field that is isNumeric and is NULL, so I'll have to say in bd if it's numeric, do one thing if it's not another, right?     

asked by anonymous 08.03.2017 / 19:01

0 answers