PHP Classes

Using the Ajax Form AND ClientSide Popdown Validation

Recommend this page to a friend!

      PHP Forms Class with HTML Generator and JavaScript Validation  >  PHP Forms Class with HTML Generator and JavaScript Validation package blog  >  How to Show Google Ma...  >  All threads  >  Using the Ajax Form AND ClientSide...  >  (Un) Subscribe thread alerts  
Subject:Using the Ajax Form AND ClientSide...
Summary:Using the Ajax Form AND ClientSide Popdown Validation
Messages:3
Author:Mike T.
Date:2008-12-09 17:55:08
Update:2009-04-08 08:25:30
 

  1. Using the Ajax Form AND ClientSide...   Reply   Report abuse  
Picture of Mike T. Mike T. - 2008-12-09 17:55:08
Hello,

I'm trying to use the test_ajax_form.php to submit my form but I would like to use the client side Pop down and highlighting for the validation.

In other words, what do I need to put in the following if statement?

/*
* Are there any form validation errors?
*/
if(strlen($error_message))
{

/*
* Tell the form submitter input to send to the browser
* an order to display validation error feedback message.
*/
$title = "Validation error";
$output = HtmlSpecialChars($error_message);
$active = 0;
$icon = '';
ob_start();
require('templates/message.html.php');
$content = ob_get_contents();
ob_end_clean();
$form->SetInputProperty("sender", "Feedback", $content);
}

Thank you in advanced, Mike.

  2. Re: Using the Ajax Form AND ClientSide...   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2008-12-09 19:22:27 - In reply to message 1 from Mike T.
Good question. Currently the class does not provide a way to do that. I will add it to the to do list.

Meanwhile you can add actions to the AJAX response with Javascript code to change the class of the invalid inputs directly. Just let me know if you do not know how to do that.

  3. Re: Using the Ajax Form AND ClientSide...   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2009-04-08 08:25:30 - In reply to message 1 from Mike T.
Just a notice that I finally implemented an action that marks a field as valid or invalid depending on its validation state.

This means that it may update the CSS class or styles according to your settings of the form or the respective input options.

The actions is named MarkValidated and you can get the necessary Javascript to trigger this action by calling GetJavascriptConnectionAction or use the ConnectAction response action of the AJAX submit plug-in.

Simpler than this may be using the just released scaffolding plug-in that provides transparent AJAX support and makes use of this action. Read more about this here:

phpclasses.org/blog/package/1/post/ ...