4 개의 요소가있는 양식이 있습니다. 내 양식에서 네 번째 요소로 설정 한 이미지를 클릭하면 jquery 팝업을 열어야합니다. 팝업 창에는 다른 양식과 제출 버튼이 있습니다. herepopup 오지 마. 내가 할 일은 뭐지?jquery 팝업 div에서 양식의 요소를 클릭하십시오.
이이 내 JQuery와
<script type="text/javascript">
function callPopup(id) {
console.log(id);
var datastring = "&event_id="+id;
$.ajax({
url: 'event_edit_popup.php', //enter needed url here
data: datastring,
type: 'get', //here u can set type as get or post
success: function(data) {
$('.popupContent').html(data);
console.log(data);
$('.loader1').hide();
$("#popup_content").after(data);
// u can see returned data in console log.
// here, after ajax call,u can show popup.
}
});
};
</script>
내 양식
echo "<div class=\"addform\">
<form method='GET' action=\"update_events.php\">\n";
echo " <input type=\"hidden\" name=\"column1\" value=\"".$row['event_id']."\"/>\n";
echo " <input type=\"text\" name=\"column2\" value=\"".$row['event_name']."\"/>\n";
echo " <input type=\"text\" name=\"column3\" value=\"".$row['description']."\"/>\n";
echo " <input type=\"image\" src=\"images/update.png\" id=\"update_event\" alt=\"Update Row\" class=\"topopup\" onClick=\"callPopup(".$row['event_id'].")\"; title=\"Update Row\">\n";
}
echo "</table></form><br />\n";
이며,이 내 팝업 DIV이다
<div id="toPopup">
<div class="close"></div>
<span class="ecs_tooltip">Press Esc to close <span class="arrow"></span></span>
<div id="popup_content"> <!--your content start-->
<p align="center">edit company</p>
</div> <!--your content end-->
</div> <!--toPopup end-->
<div class="loader"></div>
<div id="backgroundPopup"></div>
클릭하면 어디에서 기능을 수행 할 수 있습니까? – ShibinRagh
양식의 네 번째 입력 요소로 @ShibinRagh onClick = \ "callPopup (". $ row [ 'event_id']. "); – rrahul
코드가 깨졌습니다. 'onclick'을 절대로 닫지 마십시오. –