0
$(document.getElementById("buttonClicked")).click(function(e) {
swal({
imageUrl: "http://www.petdrugsonline.co.uk/images/page-headers/cats-master-header",
title: "sentence: ",
text: "0/140",
type: "input",
showCancelButton: true,
closeOnConfirm: true,
closeOnCancel: true,
}, function(text) {
if (inputValue.length > 140) {
swal.showInputError("You need to write something!");
}
// fire post
$.post("/index.php", {
img: finalDataURL,
text: text
}).done(function(data) {
});
});
});
入力(0/140 - > 1/140 - > 2/140 - > etc)内に入力された文字ごとにテキストが更新されるように修正したい場合、ユーザーがsubmitをクリックしようとしたときに、入力した文字数が140を超えると、エラーがポップアップします。sweetalertで文字数制限を設定するにはどうすればよいですか?
今、私のコードはそれをしていません。