// This file depends heavily on jquery, jquery validation, jquery ui and bootstrap.js. So be nice and include them on the page.
$(function () {
$('form').validate();
$('input.datepickerify').datepicker($.datepicker.regional["fa"]);
/* Setup tooltip */
$('.form-help').each(function () {
if ($(this).data('for') != undefined) {
$('#' + $(this).data('for')).tooltip({ trigger: 'focus', title: $(this).attr('title'), placement: 'left' });
}
$(this).tooltip();
});
// $('.assess-inputs').each(function () {
// $(this).bind('submit', function (e) {
//var alert = '
فرم شما خیلی خلوته!
با این شرایط ما نمیتونیم به شما کمک کنیم. اگر مایل هستید اطلاعات بیشتری پر کنید.
';
//$(this).children('input[type=submit], button[type=submit]').fadeOut('fast')
//$(this).prepend(alert);
//$(this).data('sparse-alert-showed', 'true');
//e.preventDefault();
// });
// });
$(document).on('submit', 'form', function (e) {
if ($(this).validate()) {
$(this).find('button').attr('disabled', 'disabled');
$(this).find('input[type=submit]').attr('disabled', 'disabled');
}
});
//var i;
//i = 0;
//$('button[type=submit]').on('focus', function (e) {
// if (i <= 0)
// alert('اگر فیلدها را وارد کردید دوباره کلیک کنید!');
// i++;
//});
//$("button[type=submit]").on("click", function (e) {
// $(this).attr('disabled', 'disabled');
//});
//$("input[type=submit]").on("click", function (e) {
// $(this).attr('disabled', 'disabled');
//});
});