Powered by Vanilla 1.1.2.
I have created a script for using Uni-Form with Prototype instead of JQuery.
Just download uni-form.prototype.js an put it together with prototype.js in your javascript folder.
Then replace
<script src="js/jquery.js" type="text/javascript"></script>
<script src="js/uni-form.jquery.js" type="text/javascript"></script>
with
<script src="js/prototype.js" type="text/javascript"></script>
<script src="js/uni-form.prototype.js" type="text/javascript"></script>
and you are done.
Here is the code:
//Prototype script for Uni-Form by Patrick Daether - http://www.ihr-freelancer.de
uniform = {
settings: { valid_class : 'valid',
invalid_class : 'invalid',
focused_class : 'focused',
holder_class : 'ctrlHolder',
field_selector : '.uniForm input, .uniForm select, .uniForm textarea'
},
// Select form fields and attach them higlighter functionality
init: function(){
$$(uniform.settings.field_selector).invoke('observe','focus',uniform.changeFocus);
},
// Focus specific control holder
changeFocus: function(evt){
$$('.'+uniform.settings.focused_class).invoke('removeClassName',uniform.settings.focused_class);
$(Event.element(evt)).up('.'+uniform.settings.holder_class).addClassName(uniform.settings.focused_class);
}
}// Auto set on page load...
Event.observe(window, 'load', uniform.init );
Tested with Prototype 1.5.1 and Uni-Form 1.2.
Wow, thanks! This should come in handy for Marcus and the rails plugin he's making. Also I am putting it to the resources section.
1 to 2 of 2