This topic is locked

Verify Entry

8/24/2007 1:16:51 PM
PHPRunner General questions
G
gshafer author

I am using PHPRunner V 4.1 Bulid 295.
I have a form that users fill in and one of the fields is a filename. Certain characters are not allowed to be used in the name (such as * / .).
Does anyone know of a way to check a field for the presence of these characters and then not save the information if these charaters are in the field ?
Thanks....George

J
Jane 8/27/2007

George,
to check field value use Before record added or Before record updated event on the Events tab.

Here is a sample code:

if (strpos($values["FieldName"],'/'))

{

echo "Error";

return false;

}

else

return true;

G
gshafer author 8/27/2007

Thanks.
This works well if the character is anywhere in the string except at the very beginning.
Anyone have a solution that would also catch these characters if they are the first one on the string?
.......George

George,

to check field value use Before record added or Before record updated event on the Events tab.

Here is a sample code:

Alexey admin 8/28/2007

George,
here is the code:

if (strpos($values["FieldName"],'/')!==false)

{

echo "Error";

return false;

}

else

return true;