Hi guys,
I am trying to get contents of a page into a popup div when user clicks on the View sample plan link in the table with the id='plans' below.
I will change the contents of junk.php once I can get it working.
Thanks to everyone who can help me out.
Sunny124
<script type='text/javascrit'>
$('.sample_plan').click(function(){
var current_plan_id = 0;
while(current_plan_id < ('.sample_plan').length){
if($(this).hasClass(current_plan_id)){
alert('clicked view sample plan '+ current_plan_id); // works
$("#planpopup").load('junk.php', function(response, status, xhr){
if (status == "error") {
var msg = "Sorry but there was an error: ";
alert(msg);
}
});
$("#planpopup").fadeIn(1000);
$('#plan_popup_background').css({'display':'block', 'height': $(window).height(), 'opacity': 0.3});//display transparent background
break;
}
current_plan_id++;
}
});
$(".close_popup_link").click(function(){//close popup when close link on popup is clicked
$("#planpopup").css({'display':'none'});
$('#plan_popup_background').css({'display':'none'});
});
</script>
<div id="planpopup">
<div class="close_popup"><a href="#" class="close_popup_link">close X</a></div>
</div>
<div id="plan_popup_background"></div>
<table id="plans">
<tr>
<th colspan="4">
Choose your plan<span class='required_'>*</span>
</th>
</tr>
<tr class="first">
<td>
<label name="Listing_Package">Listing Package</label>
</td>
<td>
<label name="Description">Description</label>
</td>
<td class="price">
<label name="Price">Yearly Cost ($)</label>
</td>
<td>
</td>
</tr>
<? foreach($plans as $plan){
?>
<tr class="<?="row$plan->id";?>">
<?
//$file = getcwd().'/application/views/ozshaadi/view_demo_plan'.$plan->id.'.php';
// if(file_exists($file)){
?>
<td class="left_colum">
<label name="plan_name"><?=$plan->name;?></label>
<br/>
<a href="#" class="sample_plan <?=$plan->id;?>">View sample plan</a>
</td>
<td>
<label name="plan_descrip"><?=$plan->description;?></label>
</td>
<td>
<label name="plan_price"><?=$plan->yearly_cost;?>.00</label>
</td>
<td>
<input type="radio" name="listing_plan_id" class="radiobx" <?=set_radio('listing_plan_id',$plan->id);?> id="plan<?=$plan->id;?>" value="<?=$plan->id?>"/>
</td>
</tr>
<? }
?>
<tr class="radio_btn_error"></tr>
</table>
junk.php
<p>some text</p>