views:

22

answers:

1

Hi,
I am using formcheck mootools plugin.

On clicking edit button:
I need to trigger when form submit; when validation is success.
I need to see error messages when validation fails.



new FormCheck ('editForm',
{
submit: false,
onValidateFailure: function() {
alert('fail');
},
onValidateSuccess: function() {
alert('success');
}
}
);



$('editButton').addEvent('click', function()
{
$$('#action').set('value', 'update');
$('editUserForm').submit();
}
);

A: 

$each($$('input[type=submit]'),function(el) {
el.addEvent('click',function(e) {
if(this.value == "Update")
{
$('action').set('value','update');
}
else
{
$('action').set('value','delete');
}
}.bind(el));
});

v_srinath