0
データ検証を行うJavaScript関数がありますが、データが間違っていると警告するために警告を使用しています。私がしたいのは、ブートストラップモーダルウィンドウを表示してエラーを表示することです。これは私がやったことなので、うまくいきません。 var contador = somevalue;
window.validar = function (cual){ if(cual.value == -1){
js関数からブートストラップ・モーダルを呼び出す
}
if($("#muestragrafico1").is(':checked')){
var cantidad = 3;
}else{
var cantidad = 1;
}
if(cual.checked){
contador++;
}else{
contador--;
}
if(contador <= cantidad){
return true;
}else{
if (cantidad == 3) {
//alert("Solo puede seleccionar un máximo de "+cantidad+" sensores.");
$('#myModalExito').modal('show');
}
if (cantidad == 1) {
alert("Solo puede seleccionar un máximo de "+cantidad+" sensores.");
}
contador--;
return false;
}
}`
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title"><?php echo L::Ticket_Succes?></h4> </div>
</div>
</div>
あなたは 'document.ready()'関数を使うのですか? – farhadamjady
あなたはあなたのモーダルに 'myModalExito'をIDとして割り当てましたか? – Founded1898
はい、しました。私はちょうどその部分をコピーしていない。 – sinaxtis