ProtoFormClass

ProtoFormClass is a Prototype class that allows you to very easily validate the forms fields and send data in ajax: you can view the source code here. I have rewritten the code of the old script to make it more object-oriented greatly simplifying deployment.

Features

Implementations

ProtoformClass utilise the field elements id attribute to indicate the validation requirements (through prefixes). The title attribute of the form fields (to be valitated) is used to show an error message; assign an id to each of these fields with your prefix and the type of validation desired. If You want, customize form stylesheets, loading, errors and response message (ul#error, div#response, p#working, displayed with dhtml).

Event.observe(window,"load",function() {		
	new Protoform('myform', { ajax:false });
	$$("form.myotherforms").each(function(forms){ 
    		new Protoform(forms);     
	});
});

Options

Class options:

Validation options (field elements id attribute prefix):

 
Test ProtoFormClass (demo example)
 

Download

Get ProtoFormClass (27/10/2008) - the package contains an working example and Prototype 1.6 library.

Suggestions

You can post your comments, suggestions or bug reports on my blog: I'm happy to receive aid to improve the script.

License

ProtoFormClass is licensed under the MIT license.