Joomla! & Javascript form validation

Few days ago I decided to look into an issue that was reported on our forum. Basically the form validation in CMC was not working on Safari. The whole thing was very strange because we are using the Joomla! js classes to validate the form before submitting, so there was no reason why all this would not work. As I looked into the code I discovered things that I never knew & thought that it is a good idea to share them with other developers.

Since the Joomla! 1.5 days developers were able to use JHtml::_('behavior.formvalidation'); if they want to validate their forms with javascript before submitting. On Joomla 3.3 the formvalidation function looks like this.

Continue reading
Rate this blog entry:
2
7956 Hits
5 Comments

Ajax requests on multilingual joomla websites

Today I've been working on making Hotspots multilingual ready. Since joomla 1.6 creating multilingual websites started to look like a piece of cake. There are several tutorials that explain how website administrators could do that: http://magazine.joomla.org/issues/issue-nov-2011/item/593-Build-a-Multilingual-Site-in-Joomla-1-7

And there is also a very good webinar that CloudAccess organised and recorded:http://www.youtube.com/watch?v=gnhVVtyejPg

Continue reading
Rate this blog entry:
4
41707 Hits
1 Comment

Working with Javascript in Joomla - Part 1

As Douglas Crockford puts it: “Javascript is the world’s most misunderstood language” . I think that in the Joomla universe this statement is 200% accurate. Most of the extension developers out there are good with PHP, but when it comes to javascript one wants to just find that snippet online, copy & paste it and forget about it - code quality here is not that important! And I say doh! It is important!

Joomla extensions are installed on 1000s of websites. But the thing is – users don’t install just 1 extension. They install a lot of them! Modules, plugins, and components – everything is thrown into the mix. And out of one small JS mess we get one big mess! Javascript is mixed with html, global variables are all over the place, there is no trace of modularity, no trace of good design patterns and it is just painful to watch. If you are lucky enough – your component will work and you won’t have to do any support, but as it happens most of the time – your extensions are not going to work because of other peoples copy and pasting!

Continue reading
Rate this blog entry:
3
24083 Hits
0 Comments