Showing posts with label Ajax. Show all posts
Showing posts with label Ajax. Show all posts

Monday, September 26, 2011

Web develop tools....

Some useful links for help designing and developping....

1) Create image of loading state....: http://www.ajaxload.info/

2) Create simple and clean forms, js and css inclusive...: http://www.phpform.org/

3) Search free icons(very good!!): http://findicons.com/

4) Test, and produce over 68 differents screenshot for each browser for your site: http://browsershots.org/

Bye...

Monday, September 19, 2011

Mootools FormCheck: Ajax configuration

Currently I need to use a, ready to use, form to login....
I decide to use form-check of mootools available at:
http://mootools.floor.ch/docs/formcheck/files/formcheck-js.html

This is my configuration to allow ajax authentication(script tag in the head...)
No other configuration. The rest is the pure standard form-check:

<script type="text/javascript">
        window.addEvent('domready', function(){loginFormCheck = new FormCheck('formular', {
            submit : false,
            submitByAjax: true,
            submitAction: './loginManager',                //Action page used to submit the form data to.
            submitMethod: 'post',                //Method used to submit the form, valid options : 'post' or 'get'
            onAjaxRequest : onAjaxRequest,                //Function to fire when the Request event starts
            //onAjaxComplete : onAjaxComplete,            //Function to fire when the Request is complete, before and regardless of Success or Failure
            onAjaxSuccess : onAjaxSuccess,   
            display : {
                errorsLocation : 1,
                indicateErrors : 2,
                flashTips : true,
                fadeDuration : 1500,
                scrollToFirst : false
            },
            alerts : {
                required : 'This field is ablolutely required! Please enter a value'
            }
        })});
       
        function onAjaxRequest () {
            document.getElementById("loadingDiv").style.display = "block";
        }
       
        function onAjaxSuccess () {
            document.getElementById("loadingDiv").style.display = "none";
            window.location = "./home.jsp";
        }
       
       
    </script>

loadingDiv is a div where I have a simply "loading" animated gif.
loginManager is my servlet the manage the login logic.
Bye