tags:

views:

64

answers:

1

Does anyone know how to customize the $(form).block(); message below? Please help

$(document).ready(function() { 
$('#form1').validate({ 
    rules: { 
        fieldone: { required: true }, 
        fieldtwo: { required: true } 
    }, 
    submitHandler: function(form) { 
        $(form).block(); 
        form.submit(); 
    } 
}); 

$('input:checkbox[name=toggleone]').click(function() { 
    if ($(this).is(':checked')) { 
        $('input[name=fieldone]').rules('add', { required: true }); 
    } else { 
        $('input[name=fieldone]').rules('remove'); 
    } 
}); 

$('#altsubmit').click(function() { 
    $('input[name=fieldtwo]').rules('remove'); 
    $('#form1').submit(); 
}); 

});

+1  A: 

There's an example of that on the plugin's website: http://jquery.malsup.com/block/#element

This example is, and I quote:

   $('#blockButton2').click(function() { 
        $('div.test').block({ 
            message: '<h1>Processing</h1>', 
            css: { border: '3px solid #a00' } 
        }); 
    });

So just put whatever message you want where it says Processing ;)

Calle
It's strange because the main page tell that the method to block is `BlockUI`
Eduardo Molteni
It's not strange, really. To block a full page you use $.blockUI and to block an element you use $("selector").block()... Or so it appears (I haven't tried it).
Calle