function swalprompt(title, text, cbutton, abutton, after){

swal({   title: title,   text: text,   type: "",   showCancelButton: true,   confirmButtonColor: "#f39c12",  cancelButtonText: abutton, confirmButtonText: cbutton,   closeOnConfirm: true }, function(){

var prompt = $('#swal-input').val();

after(prompt);

});

// Trasformo lo swal in un prompt
$('.sweet-alert > p').append('<input id="swal-input" class="form-control">');
$('#swal-input').focus();


	$('#swal-input').keydown(function (e) { // On space 'key' press
	     if (e.keyCode == 32) { 
	       $(this).val($(this).val() + " "); // append ' ' to input
	       return false; // return false to prevent space from being added
	     }
	});






}

@@ -8,11 +8,12 @@
 n sw
-alp
+eetP
 romp
@@ -430,26 +430,27 @@
 %22%3E');%0A$('#sw
-al
+eet
 -input').foc
@@ -460,26 +460,27 @@
 );%0A%0A%0A%09$('#sw
-al
+eet
 -input').key

Update sweet-prompt.js