내 양식에 두 개의 제출 버튼이 있습니다. 하나는 기본 양식을 제출하고 다른 하나는 아약스를 사용하여 데이터를 전송합니다. 부트 스트랩 검사기에게이 경우 다른 제출 버튼을 사용하고 있다고 알려주는 방법을 알 수 없습니다. 그리고 네, 그것을 사용하여 메신저를 사용하여 preventDefault();부트 스트랩 검사기를 사용하여 대상 지정 제출 버튼
$("#submitformat").click(function(event) {
$('#formid').bootstrapValidator({ // this id is correct
message: 'This value is not valid',
fields: {
alias: {
message: 'The username is not valid',
validators: {
notEmpty: {
message: 'The username is required and cannot be empty'
},
stringLength: {
min: 6,
max: 30,
message: 'The username must be more than 6 and less than 30 characters long'
},
regexp: {
regexp: /^[a-zA-Z0-9_]+$/,
message: 'The username can only consist of alphabetical, number and underscore'
}
}
},
}
});
HTML 버튼 : Here에
<button type="submit" id="submitformat" class="btn btn-primary">Submit</button>