This topic is locked

Validate Text Field

11/13/2008 1:21:07 PM
PHPRunner General questions
R
rainerwolf author

Hi,

is it possible to validate a text field? Only allowed are alphabetic characters, no special characters as @ = ( ) and so on.

If it is, what must i do?
Rainer

E
e61 11/13/2008

Hi,

is it possible to validate a text field? Only allowed are alphabetic characters, no special characters as @ = ( ) and so on.

If it is, what must i do?
Rainer


Try this:

$string = $values["Some_Field"];

if (eregi('[^a-z]', $string)) {

return true;

} else {

return false;

}
R
rainerwolf author 11/18/2008



Try this:

$string = $values["Some_Field"];

if (eregi('[^a-z]', $string)) {

return true;

} else {

return false;

}



OK, thank you very much for your answer, i will try it.

Rainer