입력 값 만 입력하면 사용자가 파일을 업로드 할 수 있습니다. 버튼을 클릭하자마자 파일 업로드 창이 열립니다. 원하지 않습니다. 사용자가 아래 명시된 입력 파일에 값을 입력하지 않으면 팝업됩니다. 이러한 입력은 다음과 같습니다자바 스크립트를 사용하여 업로드 창 차단 팝업
<input type="text" id="id" placeholder="Enter Audit ID" autocomplete="off">
<input type="text" id="email_id_upload" placeholder="Enter Email_id " autocomplete="off">
이 업 로더입니다 :
<form>
<input type="file" name="file" id="file"><br>
<input type="button" name="submit_file" value="Submit">
</form>
그리고이 사용자가 입력하는 모든 값이있는 경우 JS 확인하는 것입니다
$('#file').click(function(){
var email_id_upload= $('#email_id_upload').val();
var id = $('#id').val();
if(email_id_upload.length !==0 && id.lenght !==0)
{
//allow upload window to pop up
}
else
{
if(email_id_upload.length ===0 && id.length ===0)
{$('#message_content2_1').html("<span style='color:red'>Please fill email id and audit id</span>");}
else{
if(email_id_upload.length ===0)
{$('#message_content2_1').html("<span style='color:red'>Please fill email id</span>");}
if(id.length ===0)
{$('#message_content2_1').html("<span style='color:red'>Please fill email id and audit id</span>");}
}
}
});
클릭 기능에 클릭 반환을 추가하여 아무 것도 수행하지 못하게 할 때마다 추가하십시오. –