PHP Classes

Problem with SubForm validation server-side?

Recommend this page to a friend!

      PHP Forms Class with HTML Generator and JavaScript Validation  >  All threads  >  Problem with SubForm validation...  >  (Un) Subscribe thread alerts  
Subject:Problem with SubForm validation...
Summary:I can validate two SubForms client-side, but not server-side
Messages:3
Author:Chris Gibson
Date:2006-05-09 06:50:33
Update:2006-05-10 11:30:37
 

  1. Problem with SubForm validation...   Reply   Report abuse  
Picture of Chris Gibson Chris Gibson - 2006-05-09 06:50:34
Hi,

I have created one single form that I've separated into two distinct sections using the "SubForm" parameter on each field.

The separate validation works exactly as expected on the client-side, ie, when I submit one of the two sub-forms, only the fields of that sub-form are validated.

However, once the form is submitted, *all* fields are validated on the server-side, whether they are contained in the sub-form or not. Is this the intended behaviour? Is server-side validation of sub-forms not possible? Or am I doing something wrong?

Many thanks for any advice that anyone can offer!

  2. Re: Problem with SubForm validation...   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2006-05-09 18:00:38 - In reply to message 1 from Chris Gibson
You need to specify which sub-form you want to validate using the second parameter of the Validate() function call.

  3. Re: Problem with SubForm validation...   Reply   Report abuse  
Picture of Chris Gibson Chris Gibson - 2006-05-10 11:30:37 - In reply to message 2 from Manuel Lemos
Brilliant, that's solved the problem. Thanks!