You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

44 lines
2.0 KiB

// 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 = '<div class="alert alert-info fade in rtl"><button type="button" class="close pull-left" data-dismiss="alert" aria-hidden="true">×</button><h4>فرم شما خیلی خلوته!</h4><p>با این شرایط ما نمیتونیم به شما کمک کنیم. اگر مایل هستید اطلاعات بیشتری پر کنید.</p><p><button type="submit" class="btn btn-danger">ارسال آگهی</button></p></div>';
//$(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');
//});
});