Added new element to listen on and added check if jquery validation plugin is loaded.
This commit is contained in:
parent
17042f4151
commit
583d75350b
1 changed files with 2 additions and 3 deletions
|
@ -1,14 +1,13 @@
|
|||
$(document).ready(function()
|
||||
{
|
||||
// Catches forms being submitted
|
||||
$('form.ajax input[type=submit]').click(function()
|
||||
$('form.ajax input[type=submit],form.ajax button.submit').click(function()
|
||||
{
|
||||
// Grabs the form
|
||||
var form = $(this).parents('form').get();
|
||||
|
||||
// Checks that it's valid
|
||||
// @todo Check that the validation plugin is available
|
||||
if ($('form').valid() == true)
|
||||
if (typeof form.valid == 'undefined' || form.valid() == true)
|
||||
{
|
||||
// Hides the buttons on the form
|
||||
$('button, input', form).attr('readonly', 'readonly');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue