PHP Classes

focus when invalid

Recommend this page to a friend!

      PHP Forms Class with HTML Generator and JavaScript Validation  >  All threads  >  focus when invalid  >  (Un) Subscribe thread alerts  
Subject:focus when invalid
Summary:focus when invalid
Date:2012-09-12 14:31:43
Update:2012-09-12 22:46:25

  1. focus when invalid   Reply   Report abuse  
bartb - 2012-09-12 14:31:44
Dear Manuel,
thank you for your excellent class, I use it a lot.

In some of my forms I use a wysiwyg editor (tinyMCE) to replace the textareas. When a user makes an error in such a field on validation, the original (plain text) textarea is made visible and gets the focus and is shown above the tinyMCE field.
Is there a way to turn this of, so that textareas wont be made visible?

thanks for your help, Bart

  2. Re: focus when invalid   Reply   Report abuse  
Manuel Lemos - 2012-09-12 22:46:25 - In reply to message 1 from bartb
I am not sure if I understood the problem.

Are you using TinyMCE with the forms class?

The class comes with a plug-in for visual editor similar to TinyMCE. There is also a plug-in for integrating with FCKEditor. ...

These plug-ins integrate well with the class, so they do not have the problem you mention.

Other than that, the focus is only given to invalid inputs. If you disable the validation of the textarea inputs you are using in the form, they will not be validated on the browser side and so they do not get the focus. If you set the ValidateOnlyOnServerSide parameter it will still validate on the server side.