This topic is locked
[SOLVED]

 Field validation against other field

1/7/2011 3:47:20 PM
PHPRunner General questions
Francisco author

Hi there. I have been browsing the forum and PHP User Manual, and I did not find a solution for this. May be someone can help.
I am building an Add Form, and I want to validate that an email field is equal to another one in the form. I tried custom validation, but it seems not reading form values.
Does anybody solved this before?
Thanks!
Francisco

Sergey Kornilov admin 1/8/2011

You can do this, for example, in BeforeAdd/BeforeEdit events.

if ($values["field1"]==$values["field2"])

{ // do something }

else

{ // do something else }


You can also try to create your own Javascript validation plugin to access form variables before submitting the form.

More info at the end of this article: http://xlinesoft.com/phprunner/docs/validation_types.htm