cronometro.js 1.1 KB
Newer Older
1 2
var start;
var finish;
Angel MAS committed
3 4 5 6 7 8
jQuery(function ($) {
	start = new Date();

    $('form').submit(function(){

    finish= new Date();
9 10
	var tiempo = (+finish - +start) / 1000;
	jQuery("#landing_form").append('<input type="hidden" name="session_time" value="'+tiempo+'" />');
Angel MAS committed
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40

    $('input[type=submit]', this).attr('disabled', 'disabled');

    swal({
      text: "Espera por favor, estamos validando tus datos de registro...",
      icon: "http://www.hullvanhire.co.uk/public/themes/vanhire/images/loading.gif",
      button: false,
      closeOnEsc: false,
      closeOnClickOutside: false,
      closeOnConfirm: false,
      closeOnCancel: false
    });

    
    $('body').keypress(function(event){
      if (event.keyCode == 10 || event.keyCode == 13) 
        swal({
          text: "Espera por favor, estamos validando tus datos de registro...",
          icon: "http://www.hullvanhire.co.uk/public/themes/vanhire/images/loading.gif",
          button: false,
          closeOnEsc: false,
          closeOnClickOutside: false,
          closeOnConfirm: false,
          closeOnCancel: false
        });
    });
    
  });

  });