The following is an example of the imYUILogin widget with the panel option. When using the panel option, you have to supply the container type, the form id, the submit url and the success url. The success url option is only needed if you want the user to be redirected to another page upon a successful login. You can optionally supply the container width (the default is '175px').
var imYUILogin = new YAHOO.INTRIG.imYUILogin('frmLogin', {
urls: {submit: 'login.php', success: 'index.php'},
container: {id: 'imYUILogin', type: 'panel'}
});
Note: You have the option of using the urls.success option or placing your redirection string in the json record that is returned from the server.
When a user attempts to login, you should return a json object from the server:
{"type":"message", "label":"login success"}
or
{"type":"message", "label":"login failed"}
As noted above, you can optionally return a redirection string.
{"type":"continue"}
or
{"type":"continue", "label":"success.php"}
Click here to view the example of the imYUILogin widget with the panel option. Enter anything for the username and password to view the 'login failed' message. Enter demoUser for the username and demoPass for the password to login successfully.
View the source in the panel example to see how I set it up. Notice that I used the YUI Loader to load all the necessary files.
For more documentation regarding the imYUILogin Widget, view my blog post.