<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.sandbox.joomla.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Rodrigo+i+s</id>
	<title>Joomla! Documentation - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.sandbox.joomla.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Rodrigo+i+s"/>
	<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/Special:Contributions/Rodrigo_i_s"/>
	<updated>2026-09-17T17:55:45Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Talk:Client-side_form_validation&amp;diff=15834</id>
		<title>Talk:Client-side form validation</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Talk:Client-side_form_validation&amp;diff=15834"/>
		<updated>2009-10-04T09:00:42Z</updated>

		<summary type="html">&lt;p&gt;Rodrigo i s: /* Is the code example in &amp;quot;Really only accept form after validation&amp;quot; wrong? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Validation works, but.. ==&lt;br /&gt;
&lt;br /&gt;
On a component of my own in backend, this makes the validation, returns the error, but data in the form are lost:&lt;br /&gt;
&lt;br /&gt;
 function save()&lt;br /&gt;
 {&lt;br /&gt;
  global $mainframe;&lt;br /&gt;
  JRequest::checkToken() or jexit( &#039;Invalid Token&#039; );&lt;br /&gt;
  $email = JRequest::getString(&#039;email&#039;, &#039;&#039;); // start email validation&lt;br /&gt;
  if($email != null) // email is not required but if isset must be valid&lt;br /&gt;
  {&lt;br /&gt;
  jimport( &#039;joomla.mail.helper&#039; );&lt;br /&gt;
      if (!JMailHelper::isEmailAddress($email))&lt;br /&gt;
      {&lt;br /&gt;
      $mainframe-&amp;gt;enqueueMessage(&#039;Email not valid&#039;, &#039;error&#039;);&lt;br /&gt;
      return $this-&amp;gt;execute(&#039;edit&#039;);&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
   $row =&amp;amp; JTable::getInstance(&#039;mytable&#039;, &#039;Table&#039;);		&lt;br /&gt;
   if (!$row-&amp;gt;bind(JRequest::get(&#039;post&#039;))) &lt;br /&gt;
      {&lt;br /&gt;
      JError::raiseError(500, $row-&amp;gt;getError() );&lt;br /&gt;
      }&lt;br /&gt;
 }  &lt;br /&gt;
&lt;br /&gt;
What&#039;s wrong here? Any suggestion to retrieve the data that I was filling before the validation stop..?&lt;br /&gt;
&lt;br /&gt;
([[User:Dangerfield|Dangerfield]] 19:58, 13 March 2009 (UTC))&lt;br /&gt;
&lt;br /&gt;
== Add &amp;quot;validate&amp;quot; to the button class ==&lt;br /&gt;
&lt;br /&gt;
I think this is a great feature in the Joomla 1.5, and wish more developers implemented it in their forms.&lt;br /&gt;
&lt;br /&gt;
The best example of this in action is on the Joomla 1.5 registration form. \components\com_user\views\register\tmpl\default.php.&lt;br /&gt;
&lt;br /&gt;
I am not sure why they left out adding &amp;quot;validate&amp;quot; to the button class, but it is essential to performing the validation on submit.&lt;br /&gt;
&lt;br /&gt;
== Is the code example in &amp;quot;Really only accept form after validation&amp;quot; wrong? ==&lt;br /&gt;
I&#039;m new to Joomla, so I don&#039;t know if this is something that changed recently, but, at least when using JHTML::_(&#039;behavior.formvalidation&#039;), the example shown in that section does not work as one would expect. &lt;br /&gt;
Namely, the function myValidate(f) is not used. &lt;br /&gt;
&lt;br /&gt;
This seems to be because in validation.js, the attachToForm function overwrites the &amp;quot;onclick&amp;quot; value of all inputs/buttons of type &amp;quot;submit&amp;quot;. Hence the form is validated in the first place when the button itself is clicked. &lt;br /&gt;
So if the validation is wrong, the value in &amp;quot;onSubmit&amp;quot; (and therefore myValidate) will never be used. &lt;br /&gt;
&lt;br /&gt;
Am I missing something here? Otherwise I think we should change the example.&lt;br /&gt;
&lt;br /&gt;
([[User:rodrigo_i_s|rodrigo_i_s]])&lt;/div&gt;</summary>
		<author><name>Rodrigo i s</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Talk:Client-side_form_validation&amp;diff=15831</id>
		<title>Talk:Client-side form validation</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Talk:Client-side_form_validation&amp;diff=15831"/>
		<updated>2009-10-03T22:21:16Z</updated>

		<summary type="html">&lt;p&gt;Rodrigo i s: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Validation works, but.. ==&lt;br /&gt;
&lt;br /&gt;
On a component of my own in backend, this makes the validation, returns the error, but data in the form are lost:&lt;br /&gt;
&lt;br /&gt;
 function save()&lt;br /&gt;
 {&lt;br /&gt;
  global $mainframe;&lt;br /&gt;
  JRequest::checkToken() or jexit( &#039;Invalid Token&#039; );&lt;br /&gt;
  $email = JRequest::getString(&#039;email&#039;, &#039;&#039;); // start email validation&lt;br /&gt;
  if($email != null) // email is not required but if isset must be valid&lt;br /&gt;
  {&lt;br /&gt;
  jimport( &#039;joomla.mail.helper&#039; );&lt;br /&gt;
      if (!JMailHelper::isEmailAddress($email))&lt;br /&gt;
      {&lt;br /&gt;
      $mainframe-&amp;gt;enqueueMessage(&#039;Email not valid&#039;, &#039;error&#039;);&lt;br /&gt;
      return $this-&amp;gt;execute(&#039;edit&#039;);&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
   $row =&amp;amp; JTable::getInstance(&#039;mytable&#039;, &#039;Table&#039;);		&lt;br /&gt;
   if (!$row-&amp;gt;bind(JRequest::get(&#039;post&#039;))) &lt;br /&gt;
      {&lt;br /&gt;
      JError::raiseError(500, $row-&amp;gt;getError() );&lt;br /&gt;
      }&lt;br /&gt;
 }  &lt;br /&gt;
&lt;br /&gt;
What&#039;s wrong here? Any suggestion to retrieve the data that I was filling before the validation stop..?&lt;br /&gt;
&lt;br /&gt;
([[User:Dangerfield|Dangerfield]] 19:58, 13 March 2009 (UTC))&lt;br /&gt;
&lt;br /&gt;
== Add &amp;quot;validate&amp;quot; to the button class ==&lt;br /&gt;
&lt;br /&gt;
I think this is a great feature in the Joomla 1.5, and wish more developers implemented it in their forms.&lt;br /&gt;
&lt;br /&gt;
The best example of this in action is on the Joomla 1.5 registration form. \components\com_user\views\register\tmpl\default.php.&lt;br /&gt;
&lt;br /&gt;
I am not sure why they left out adding &amp;quot;validate&amp;quot; to the button class, but it is essential to performing the validation on submit.&lt;br /&gt;
&lt;br /&gt;
== Is the code example in &amp;quot;Really only accept form after validation&amp;quot; wrong? ==&lt;br /&gt;
I&#039;m new to Joomla, so I don&#039;t know if this is something that changed recently, but, at least when using JHTML::_(&#039;behavior.formvalidation&#039;), the example shown in that section does not work as one would expect. &lt;br /&gt;
Namely, the function myValidate(f) is not used. &lt;br /&gt;
&lt;br /&gt;
This seems to be because in validation.js, the attachToForm function overwrites the &amp;quot;onclick&amp;quot; value of all inputs/buttons of type &amp;quot;submit&amp;quot;. Hence the form is validated when the button itself is clicked, and not when the form is submitted. &lt;br /&gt;
So if the validation is wrong, the value in &amp;quot;onSubmit&amp;quot; (and therefore myValidate) will never be used.&lt;br /&gt;
&lt;br /&gt;
Am I missing something here?&lt;br /&gt;
&lt;br /&gt;
([[User:rodrigo_i_s|rodrigo_i_s]])&lt;/div&gt;</summary>
		<author><name>Rodrigo i s</name></author>
	</entry>
	<entry>
		<id>https://docs.sandbox.joomla.org/index.php?title=Talk:Client-side_form_validation&amp;diff=15830</id>
		<title>Talk:Client-side form validation</title>
		<link rel="alternate" type="text/html" href="https://docs.sandbox.joomla.org/index.php?title=Talk:Client-side_form_validation&amp;diff=15830"/>
		<updated>2009-10-03T22:18:25Z</updated>

		<summary type="html">&lt;p&gt;Rodrigo i s: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Validation works, but.. ==&lt;br /&gt;
&lt;br /&gt;
On a component of my own in backend, this makes the validation, returns the error, but data in the form are lost:&lt;br /&gt;
&lt;br /&gt;
 function save()&lt;br /&gt;
 {&lt;br /&gt;
  global $mainframe;&lt;br /&gt;
  JRequest::checkToken() or jexit( &#039;Invalid Token&#039; );&lt;br /&gt;
  $email = JRequest::getString(&#039;email&#039;, &#039;&#039;); // start email validation&lt;br /&gt;
  if($email != null) // email is not required but if isset must be valid&lt;br /&gt;
  {&lt;br /&gt;
  jimport( &#039;joomla.mail.helper&#039; );&lt;br /&gt;
      if (!JMailHelper::isEmailAddress($email))&lt;br /&gt;
      {&lt;br /&gt;
      $mainframe-&amp;gt;enqueueMessage(&#039;Email not valid&#039;, &#039;error&#039;);&lt;br /&gt;
      return $this-&amp;gt;execute(&#039;edit&#039;);&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
   $row =&amp;amp; JTable::getInstance(&#039;mytable&#039;, &#039;Table&#039;);		&lt;br /&gt;
   if (!$row-&amp;gt;bind(JRequest::get(&#039;post&#039;))) &lt;br /&gt;
      {&lt;br /&gt;
      JError::raiseError(500, $row-&amp;gt;getError() );&lt;br /&gt;
      }&lt;br /&gt;
 }  &lt;br /&gt;
&lt;br /&gt;
What&#039;s wrong here? Any suggestion to retrieve the data that I was filling before the validation stop..?&lt;br /&gt;
&lt;br /&gt;
([[User:Dangerfield|Dangerfield]] 19:58, 13 March 2009 (UTC))&lt;br /&gt;
&lt;br /&gt;
== Add &amp;quot;validate&amp;quot; to the button class ==&lt;br /&gt;
&lt;br /&gt;
I think this is a great feature in the Joomla 1.5, and wish more developers implemented it in their forms.&lt;br /&gt;
&lt;br /&gt;
The best example of this in action is on the Joomla 1.5 registration form. \components\com_user\views\register\tmpl\default.php.&lt;br /&gt;
&lt;br /&gt;
I am not sure why they left out adding &amp;quot;validate&amp;quot; to the button class, but it is essential to performing the validation on submit.&lt;br /&gt;
&lt;br /&gt;
== Is the code example in &amp;quot;Really only accept form after validation&amp;quot; wrong? ==&lt;br /&gt;
I&#039;m new to Joomla, so I don&#039;t know if this is something that changed recently, but, at least when using JHTML::_(&#039;behavior.formvalidation&#039;), the example shown in that section does not work as one would expect. &lt;br /&gt;
Namely, the function myValidate(f) is not used. &lt;br /&gt;
&lt;br /&gt;
This seems to be because in validation.js, the attachToForm function overwrites the &amp;quot;onclick&amp;quot; value of all inputs/buttons of type &amp;quot;submit&amp;quot;. Hence the form is validated when the button itself is clicked, and not when the form is submitted. &lt;br /&gt;
So if the validation is wrong, the value in &amp;quot;onSubmit&amp;quot; (and therefore myValidate) will never be used.&lt;br /&gt;
&lt;br /&gt;
Am I missing something here?&lt;/div&gt;</summary>
		<author><name>Rodrigo i s</name></author>
	</entry>
</feed>