english/libraries/joomla/application/component/modelform.php
/**
	 * Method to validate the form data.
	 *
	 * @param   object  $form   The form to validate against.
	 * @param   array   $data   The data to validate.
	 * @param   string  $group  The name of the field group to validate.
	 *
	 * @return  mixed  Array of filtered data if valid, false otherwise.
	 *
	 * @see     JFormRule
	 * @see     JFilterInput
	 * @since   11.1
	 */
Method to validate the form data.
@param   object  $form   The form to validate against.
@param   array   $data   The data to validate.
@param   string  $group  The name of the field group to validate.

@return  mixed  Array of filtered data if valid, false otherwise.


Method to validate the form data . @param object $form The form to validate against . @param array $data The data to validate . @param string $group The name of the field group to validate . @return mixed Array of filtered data if valid false otherwise .
function validate($form, $data, $group = null)
	{
		$data	= $form->filter($data);
		$return	= $form->validate($data, $group);
		if (JError::isError($return)) {
			$this->setError($return->getMessage());
			return false;
		}
		if ($return === false) {
			foreach ($form->getErrors() as $message) {
				$this->setError(JText::_($message));
			}
			return false;
		}
		return $data;
	}
function validate ( $ form , $ data , $ group = null ) { $ data = $ form -> filter ( $ data ) ; $ return = $ form -> validate ( $ data , $ group ) ; if ( JError :: isError ( $ return ) ) { $ this -> setError ( $ return -> getMessage ( ) ) ; return false ; } if ( $ return === false ) { foreach ( $ form -> getErrors ( ) as $ message ) { $ this -> setError ( JText :: _ ( $ message ) ) ; } return false ; } return $ data ; }
Method to validate the form data.
Method to validate the form data .
// Filter and validate the form data. // Check for an error. // Check the validation results. // Get the validation messages from the form.