Ali Habibzadeh Web Portfolio

Technologies, Graphics and UI

Default button plugin

This is a very simple and light weight but clever. plugin that looks for an element with the class of defaultbutton within each form on your page.

Initially it looks for events attached to that element and assign the first one created as a submission function to the form.

If there are no events but the default button is an anchor which has a URL then it submits the serialized query string to that URL.

And finally if it has no events and no url to go to it will give you a nag!

More details

		        
			    // Simply just add the JS to the page
			    
			    //And assign the defaultbutton class to eg. an anchor in the form
			    
			    < a href="#" class="defaultbutton">Submit