This topic is locked

Whole Number Validation

4/27/2008 7:00:33 AM
PHPRunner General questions
L
Lisa2006 author

Hi Forum,
In Visual Editor | invoice | Add Page | Edit as
I've set my productqty field to Validate As: Number
I need a way to allow for only whole number entry. i.e if user enters 10.7 then an error dialog box will display.
Thanks in advance
Lisa

J
Jane 4/28/2008

Hi,
use custom valudation in the Before record added event for this purpose.

Here is a sample:

if (!is_int($values["FieldName"]))

{

?><script>

alert("wrong type");

</script><?php

return false;

}
return true;