JS
저장 및 다운로드 버튼이있는 양식이 있는데 다운로드 버튼을 처음에 비활성화하고 싶습니다. 양식을 저장할 때 활성화해야합니다.
$("#download_form").attr('disabled', 'disabled');
$('.save-form').on('click', function(){
$("#download_form").removeAttr('disabled');
});
.fieldset
.row
.col-sm-3
= f.submit "Save", class: "btn btn-primary save-form"
.col-sm-3
= f.submit "cancel", type: :reset, class: "btn btn-primary"
.col-sm-3
%div{id: 'download_form'}
- if @customer_detail.save
= link_to "Download", download_csv_customer_detail_path(@customer_detail.id, format: "csv"), disabled: true, class: "btn btn-primary"
.col-sm-3
= link_to("Print", "javascript:print()", class: "btn btn-primary")
양식의 양식 제출 이벤트를 사용하십시오.
$("#download_form").submit(function(){
$('input[type="submit"]').prop('disabled', false);
});
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다