0
我有這種模式。當我按下「更改」按鈕時,我想啓用輸入contactModalPhoneInput。發生什麼是當我點擊按鈕,它立即關閉模式。當我重新打開它時,它有效地啓用輸入。有任何想法嗎?Modal在改變輸入狀態時關閉
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Results</h4>
</div>
<div class="modal-body">
<div class="input-group input-group-md">
<span class="input-group-addon" id="sizing-addon1"><i class="fa fa-user" aria-hidden="true"></i></span>
<input type="text" class="form-control" id="contactModalPhoneInput" placeholder="Name" aria-describedby="basic-addon1" disabled/>
</div>
<br>
<button type="button" class="btn btn-danger pull-right" data-dismiss="modal" id="btnChangePhone" onclick="changeInputState()">Change</button>
更新 關閉
</div>
謝謝!這個竅門! –