how to display html content on colorbox jquery
i want to display my html content on colobox jquery. here im usi开发者_如何学Cng ajax function to submit my data but on success function in returns some html page. now i want to display my html content on colorbox. how can i do this.. my code is something like this:
$('#submitButtonName').click(function(event) {
event.preventDefault();
alert("press");
var send=$("#ajaxadd").serialize();
alert(send);
$.ajax({
type:"POST",
url:"/patient_add",
data:send,
success: function(msg) {
$("#gg").html(msg);// here gg is the id which im try to retrieve from my html page. not getting exactly.
alert(msg);
//$(".display").colorbox({html:'<p>Hello</p>'});
}
});
$(".display").colorbox({html:send});
here is my html file. i want my patient name, uhid , age display on colorbox.
<body>
<div id="gg">
<form id="FormName11" action="/display" method="post" name="FormName11">
<table>
<tr><div align="center"><h2><b><u>Fortis-Medremind Patient Receipt</u></b><h2></div></tr>
</table>
<table>
<b>PatientName</b>: {{patientinfo_all.name}}
<br>
<b>UHid</b> : {{patientinfo_all.uhid}}
<br>
<b>Age</b> : {{patientinfo_all.age}}
<br>
</form>
</div>
thanx in advance..
One way is to enclose it by textarea tags.
e.g.
var response = '<textarea style="width:688px; height:458px">' + data + '</textarea>';
$.colorbox({title:'Response',width:'700px',height:'500px',html:response});
精彩评论