Code Igniter + mootools!

My favorite Javascript library had a makeover! Site looks AWESOME!

Just for the record: The mootools site was developed using Code Igniter as far as I know. So the two are a match made in heaven!

I have just replaced the script.aculo.us library as implemented by Derek Allard in his vodcast tutorial with the mootools library doing it the same way Derek did and it works like a charm!

I’ll post a guide/example on how to do it soon. (MUST just get the deadlines behind me… you know, they make that WHOOSH sound as they go by…)

Code Igniter

PS: On the mootools site, they state the compatibility with all the browsers. I love the way that they made links to ALL the browsers’ sites excepct for Internet Explorer! ;-)

technorati tags:, , ,

Blogged with Flock

Sharing is caring:These icons link to social bookmarking sites where readers can share and discover new web pages.
  • BlinkList
  • blogmarks
  • del.icio.us
  • digg
  • Fark
  • Ma.gnolia
  • muti
  • NewsVine
  • Reddit
  • Shadows
  • TailRank
  • YahooMyWeb

Code Igniter, ajax, javascript, mootools Stii

mootools - simple field validation.

We’ve looked at some very basic AJAX functionality and some basic effects using mootools, but what about something as basic as form validations?

I took my previous mootools example and added a validate function:

function validate(form1){

            if (form1) {

                if ($(’yourname’).value.trim() == “”) {

                    alert(”Name field cannot be empty”);

                    $(’yourname’).focus();

                    return;

                } else if ($(’yourmsg’).value.trim() == “”) {

                    alert(”Message field cannot be empty”);

                    $(’yourmsg’).focus();

                    return;

                } else {

                    aStiiFunction();

                }

            } else {

                if ($(’yourname1′).value.trim() == “”) {

                    alert(”Name field cannot be empty”);

                    $(’yourname1′).focus();

                    return;

                } else if ($(’yourmsg1′).value.trim() == “”) {

                    alert(”Message field cannot be empty”);

                    $(’yourmsg1′).focus();

                    return;

                } else {

                    aStiiFunction1();

                }

            }

        }

This form takes a boolean (true or false) parameter to differentiate between whether it should validate the top form (true) or the bottom form (false). If the form1 parameter is set to true, it then checks whether the yourname field and the yourmsg field is not empty. If it is not, it will submit the form using the AJAX function aStiiFunction();

What makes it so easy is that you can simply check the two text input fields by calling the element ID of either field and compare it, for example: if ($(’yourmsg1′).value.trim() == “”)

Now remember, this is very basic and simple. You can do some pretty serious regular expression checking using the same validation. But that, my friends is a story for another day!

Click here to see an example…

… and here to download the example.

technorati tags:, ,

Blogged with Flock

Sharing is caring:These icons link to social bookmarking sites where readers can share and discover new web pages.
  • BlinkList
  • blogmarks
  • del.icio.us
  • digg
  • Fark
  • Ma.gnolia
  • muti
  • NewsVine
  • Reddit
  • Shadows
  • TailRank
  • YahooMyWeb

ajax, javascript, mootools Stii

mootools example download.

Dec 05

Silly me! I forgot to zip the mootools example files up and make them available for downloading. Thank you for the reminder samiam!

Download it here!

powered by performancing firefox

Sharing is caring:These icons link to social bookmarking sites where readers can share and discover new web pages.

ajax, javascript, mootools Stii

mootools example!

Nov 22

mootools

Click here for the example!

mootools is the next version in the Mad4Milk.com library set. The guys took the moo.ajax, moo.fx and the prototype.lite library and re-worked it to exclude the prototype part of the library and combine all the moo libraries in one library. When you go download the scripts, you can decide which add-ons and plug-ins you would like to include.

Note: the moo.ajax library is deprecated and you will need to replace it with the mootools library.

If you looked at my moo.ajax example, you will note that there is only one difference in the implementation of the ajax library.

moo.ajax:

new ajax(’stii.php’, {postBody: ‘name=’ + name + ‘&msg=’ + mesg, update: $(’myelementid’), onComplete: myFunction});

mootools:

new ajax(’stii.php’, {postBody: ‘name=’ + name + ‘&msg=’ + mesg, update: $(’myelementid’), onComplete: myFunction}).request();

As you can see, the only difference is the request() at the end.

In the mootools example, I combined the ajax call with an effect to change the <div> element style.

There are many, many options in the mootools library. Here I have used the Fx.Style class to manipulate the <div> element height, width and opacity.

function myFunction(){

var myEffects = new fx.Styles(’myelementid’, {duration: 500, transition: fx.Transitions.linear});

myEffects.custom({

‘height’: [40, 100],

‘width’: [400, 300],

‘opacity’: [1,0.3]

});

}

In this example, the font color changes from white to red.

function myFunction(){

var myEffects = new fx.Color(’myelementid’, ‘color’, {duration: 500});

myEffects.toColor(’f00′);

}

TIP: The effect ALWAYS looks better in Firefox. Don’t believe me? Try it in IE then in Firefox or Flock and see the difference ;-)

Blogged with Flock

Sharing is caring:These icons link to social bookmarking sites where readers can share and discover new web pages.

ajax, javascript, moo.ajax, mootools Stii

mootools!

Nov 17

logo.png

Even working for yourself sometimes means that you cannot always do as you wish… I’ve been planning to look into Netbeans for quite some time now, but to date it stil have not realised… But hey, soon!

In the meantime, the guys from Mad4Milk.com brought out their own Javascript library, called mootools. The libraries I’ve reviewed earlier was all basd on the prototype library. mootools is their own developed library! And still, as in moo.ajax and moo.fx fashion, the footprints is still small.

Since I’m probably going to use the libs in my projects, I thought lets first have a look at the mootools library, then we’ll continue out netbeansdreams!

Coming up within the next few days: mootools example!

Blogged with Flock

Sharing is caring:These icons link to social bookmarking sites where readers can share and discover new web pages.

ajax, javascript, moo.ajax, mootools Stii


RSS Feed
Afrigator
Techleader

Recent Posts

My Posse

Filed in

Past Stuff

Meta Stuff