This topic is locked

Empty Field

2/14/2008 7:29:10 AM
PHPRunner General questions
R
rainerwolf author

Hi,
in the add/edit a record, i want to check if the input field is emtpy.

This Field is not an required field, but it must fill out depending on an value of another field.
Example:
There ia a field like age, and if the age is over 18, then the field address must be filled out, the background of the input field should be red and a message like (please fill out adress) should be send , otherwise go to another input field.
Thanks for help

J
Jane 2/14/2008

Hi,
use Before record added event for this purpose.

Here is a sample:

if ($values["AgeField"]>18 && $values["AddressField"]=="")

{

echo "Please fill address field";

return false;

}

return true;



where AgeField and AddressField are your actual field names.

R
rainerwolf author 2/14/2008

Hi,

use Before record added event for this purpose.

Here is a sample:
where AgeField and AddressField are your actual field names.


Hi Jane,

perfect, it works
Thank you very much