Skip to content

Instantly share code, notes, and snippets.

View ReactiveRaven's full-sized avatar

David Godfrey ReactiveRaven

View GitHub Profile
$(/*...*/).jqBootstrapValidation(
{
submitSuccess: function ($form, event) {
$form.ajaxSubmit({ /* your jquery.form options here */ });
event.preventDefault(); // stops the browser from submitting the form and loading a new page
}
}
);
@ReactiveRaven
ReactiveRaven / gist:3101018
Created July 12, 2012 21:07
Example hooking jquery.form up to jqBootstrapValidation
$("...").ajaxForm({
beforeSubmit: function (arr, $form, options) {
if ($form.find(":input").jqBootstrapValidation("hasErrors")) {
return false; /* we just found errors, so don't submit yet */
}
}
});
<?php
/***************
*
* My Wordpress plugin
*
*********************/
$myvar = "Hello";
function show_my_var(){