[Pieforms-commit] SF.net SVN: pieforms: [156] pieforms-php5/trunk/src/pieform.php
Status: Alpha
Brought to you by:
oracleshinoda
From: <ora...@us...> - 2006-12-27 12:54:11
|
Revision: 156 http://svn.sourceforge.net/pieforms/?rev=156&view=rev Author: oracleshinoda Date: 2006-12-27 04:54:07 -0800 (Wed, 27 Dec 2006) Log Message: ----------- Allow forms to specify an error message for jsforms. This is a small helper that stops the need to define a _error function if you want to send an error back. The message is completely optional Modified Paths: -------------- pieforms-php5/trunk/src/pieform.php Modified: pieforms-php5/trunk/src/pieform.php =================================================================== --- pieforms-php5/trunk/src/pieform.php 2006-12-27 12:49:27 UTC (rev 155) +++ pieforms-php5/trunk/src/pieform.php 2006-12-27 12:54:07 UTC (rev 156) @@ -250,6 +250,11 @@ // unknown error code 'globaljserrorcallback' => '', + // The message to pass back as a reason for the form submission failing + // if the form is a jsform. This can be used by your application however + // you choose. + 'jserrormessage' => '', + // Whether this form can be cancelled, regardless of the presence of // 'cancel' buttons or form inputs mischeviously named as to behave // like cancel buttons @@ -558,7 +563,8 @@ foreach ($errors as $element) { $json[$element['name']] = $element['error']; } - $this->json_reply(PIEFORM_ERR, array('errors' => $json)); + $message = $this->get_property('jserrormessage'); + $this->json_reply(PIEFORM_ERR, array('message' => $message, 'errors' => $json)); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |