1
양식을 제출하려고하면 colorbox에 문제가 있습니다. 색상 상자는 성공하면 열립니다. colorbox.close()를 추가하려고했습니다. 성공하면 작동했지만, 링크를 다시 클릭하여 양식을 열려고하면 양식이 표시되지 않습니다. 닫기 버튼과 오버레이 만 볼 수 있습니다. 성공 후 양식과 오버레이를 숨기려고했지만 두 번째 클릭시 양식이 열리지 않았습니다.색깔 상자가 끝 모양 뒤에 닫히지 않습니다
tweek js 파일을 보았습니다. 닫기 버튼이있는 것과 같은 버튼을 제출하는 것과 동일한 기능을 할당했지만, 물론 제대로 작동하지 않았습니다. 제출시 양식을 닫는 방법 - 제안 해주십시오.
팝업 형태 :
<div class="body" id="inline-popup">
<form action="index" method="post" id="form">
<fieldset>
<label>Name</label>
<input type="text" id="name" name="name" />
</fieldset>
<fieldset>
<label>URL (optional)</label>
<input type="text" name="url" id="url" />
</fieldset>
<fieldset>
<input type="submit" value="ok" class="submit" />
</fieldset>
</form>
</div>
colorbox 전화와 아약스 :
<script>
$(".popup").colorbox({inline:true, width:"300px", height:"100%"});
$('.submit').on('click', function(e){
$.ajax({
type: "POST",
url: '/pathname/submitForm',
data: $("#form").serialize(),
error: function(xhr, ajaxOptions, thrownError, data) {
err = Array();
err[0] = "Oops an error is occured";
console.log(err);
},
dataType: "json",
success: function(data) {
if(data.success=="yes") {
console.log(data.success);
} else {
console.log(data.error);
}
}
});
e.preventDefault();
});
</script>
내가 시도 - 초 clidk 양식 :(표시하지 않았다 –
woks! :) 나는 다시 시도했다. 감사합니다. –
@AngelM. 환영 :) – Hiral