Joomla Registration Form Validation

General questions relating to Joomla! 1.5 There are other boards for more specific help on Joomla! features and extensions.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Locked
thecar
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 110
Joined: Tue Dec 21, 2010 11:25 pm

Joomla Registration Form Validation

Post by thecar » Sun Nov 13, 2011 12:04 am

Hello all,
I would like to know how I can set a rule for each field in the standard joomla registration form, without any core hacks please? I currently cannot see any error messages when I type invalid data, is this supposed to be like this or am I missing something?
Thanks.

User avatar
zemadeiran
Joomla! Guru
Joomla! Guru
Posts: 933
Joined: Wed Oct 25, 2006 2:46 pm
Contact:

Re: Joomla Registration Form Validation

Post by zemadeiran » Sun Nov 13, 2011 2:45 am

You need to make sure the you have the message include in your sites template.

thecar
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 110
Joined: Tue Dec 21, 2010 11:25 pm

Re: Joomla Registration Form Validation

Post by thecar » Sun Nov 13, 2011 10:48 pm

Hi, is there any documentation where I can find the exact code needed, do you know?
Thanks.

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44067
Joined: Sat Apr 05, 2008 9:58 pm

Re: Joomla Registration Form Validation

Post by Webdongle » Sun Nov 13, 2011 10:52 pm

http://docs.joomla.org/Understanding_Output_Overrides

This element should only appear once in the <body> element of the Template to render system and error messages that occurred in the request.

CSS styles for system messages can be found in templates\system\css\system.css
http://docs.joomla.org/Jdoc_statements
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

User avatar
zemadeiran
Joomla! Guru
Joomla! Guru
Posts: 933
Joined: Wed Oct 25, 2006 2:46 pm
Contact:

Re: Joomla Registration Form Validation

Post by zemadeiran » Mon Nov 14, 2011 1:05 am

webdongle, I think we covered the system message include a while back in another post did we not?

Anyhoo, your thoughts on sticking it in an override as opposed to just the index.php?

I love overrides...

I will publicly admit with my head held low that I am still confused in regards to template styles in 1.6/1.7 :-[

I cannot for the life of me find anything in the documentation in relation to the use of template styles!

thecar
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 110
Joined: Tue Dec 21, 2010 11:25 pm

Re: Joomla Registration Form Validation

Post by thecar » Tue Nov 15, 2011 3:17 pm

Hi, thanks for the links..
It turns out I already have the "<jdoc:include type="message" />" line in my template folder. There are no error messages though. for example, I have a blank registration form, I click the register button but no messages come up etc. Even when typing passwords that do not match, or even an invalid email, I get nothing just the registration form as it is :eek: ?

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44067
Joined: Sat Apr 05, 2008 9:58 pm

Re: Joomla Registration Form Validation

Post by Webdongle » Tue Nov 15, 2011 3:55 pm

Try it with a standard Template ?
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

thecar
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 110
Joined: Tue Dec 21, 2010 11:25 pm

Re: Joomla Registration Form Validation

Post by thecar » Tue Nov 15, 2011 10:55 pm

Yes thats a great suggestion. It turns out the template I'm using didn't have any css to specify what happens when there is an error in the form. Thank you.

Regarding the validation rule. This is still quite unclear for me. I would like to keep all the rules the same, except for the name field. I would also like to maybe add some text to the registration form page?

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44067
Joined: Sat Apr 05, 2008 9:58 pm

Re: Joomla Registration Form Validation

Post by Webdongle » Tue Nov 15, 2011 11:09 pm

thecar wrote:... I would also like to maybe add some text to the registration form page?
You can do that in the menu item edit or for login module in the module edit screen.
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

thecar
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 110
Joined: Tue Dec 21, 2010 11:25 pm

Re: Joomla Registration Form Validation

Post by thecar » Wed Nov 16, 2011 3:38 pm

I couldn't see anything about the Registration page, only the Login form there..
Would you konw how to change the validation of one field in the Registration field also?
Thanks.

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44067
Joined: Sat Apr 05, 2008 9:58 pm

Re: Joomla Registration Form Validation

Post by Webdongle » Wed Nov 16, 2011 3:52 pm

http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".

thecar
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 110
Joined: Tue Dec 21, 2010 11:25 pm

Re: Joomla Registration Form Validation

Post by thecar » Thu Nov 17, 2011 12:14 am

Okay I got round to understanding it, and its a great feature! Thanks for the link... Would you know how I would specify a validation for the name field? I basically want to check if the user has entered more than one name (eg first and last name), if only one name, then do not validate?

User avatar
Webdongle
Joomla! Master
Joomla! Master
Posts: 44067
Joined: Sat Apr 05, 2008 9:58 pm

Re: Joomla Registration Form Validation

Post by Webdongle » Thu Nov 17, 2011 12:35 am

http://myphpform.com/validating-forms.php ???

Not sure if the variables would be defined in the default.php file or if they would be defined in another file ? Perhaps /components/com_users/views/registration/view.html.php ?

Methinks also that sql injection may need to be taken into account when altering input fields in forms ?

When you get it working, perhaps a post in the security forum to check your code is safe ?
http://www.weblinksonline.co.uk/
https://www.weblinksonline.co.uk/updating-joomla.html
"When I'm right no one remembers but when I'm wrong no one forgets".


Locked

Return to “General Questions/New to Joomla! 1.5”