YUI Widgets

imYUILogin - Module Option

I added the module option to the imYUILogin widget so that you can totally control the styling. When using the module 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: 'module'}
	});
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 module 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 module example to see how I set it up. Unlike the Dialog and Panel options, I loaded the necessary files from the Yahoo CDN.

For more documentation regarding the imYUILogin Widget, view my blog post.