required=true
属性として持つモーダルにいくつかの入力フィールドがあります。要素はの中にあり<form>
ますが、送信ボタンが押されたときに、フィールドが空白のままになっている場合、必要な警告は表示されません。テンプレートエンジンとブートストラップとしてJadeを使用しています。
編集:送信ボタンからモーダルを閉じる属性を削除すると、必要な属性が機能します。
だから問題は、必要なフィールドが入力されるまでモーダル解雇をどのように遅らせることができるかということです。
これがモーダルの翡翠です:
div#passwordModal.modal.hide.fade
div.modal-header
button.close(type='button', data-dismiss='modal', aria-hidden='true') x
h3 Password Reset
div.modal-body
form.form-horizontal.form-align-center(action='/changePass', method='post', enctype='multipart/form-data')
div.control-group
label.control-label(for='currentpass') Current Password
div.controls
input#currentpass(type='password', name='passOld', placeholder='enter old password', required=true)
div.control-group
label.control-label(for='newpass') New Password
div.controls
input#newpass(type='password', name='passNew', placeholder='enter new password', required=true)
div.control-group
label.control-label(for='newpassconfirm') Confirm
div.controls
input#newpassconfirm(type='password', name='passNew', placeholder='confirm new password', required=true)
div.control-group
button.btn.btn-success.offset3(type='submit', data-dismiss='modal', aria-hidden='true') Change Password