0

I have a field that takes case id (negative value) to evaluate the conditions.

var cont =  $('<div></div>').insertAfter(condfld).css('margin-top', '5px');
var caseidfld = $('<input id=test_caseid type=text placeholder="test caseid"></input>').appendTo(cont);

In case.id.field, I would like for the user to input the value positive value, and system will compare it with data in the database (the case id value in the database is negative). I have a clue on how to do it, using abs(), but not sure how to do it properly...

Fairy
  • 3,592
  • 2
  • 27
  • 36
Dean Statham
  • 61
  • 1
  • 4

1 Answers1

0

Try Math.abs(caseidfld) to get the absolute value. Multiply by -1 to make it negative, to compare with DB value.

AndyS
  • 750
  • 5
  • 14