Click here to Skip to main content
15,886,689 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,
this question on codeigniter.
I wrote code in view page for bootstrap model popup, in this wrote some textfields on bootstrap popup. In this I submit the form, If any valdations fails on bootstrap popup I want reopen the popup and show validation error messages on popup. When I submit the form the controle goes to controller, and here I am using codeigniter validations, not javascript validations.
Thank you.
Posted

1 solution

<!--code in your view-->
frist you need this

<input type="hidden" value="<?php echo $duration->visaId;?>" id="visaId"/>

than add this

function ViewVisaPopups(visaBr) {
var visaId = $("#visaId").val();
$(document).ready(function () {
$.ajax({
type: "POST",
url: "visa/ViewVisaPopup",
data: {visaId: visaId,visaBr: visaBr},
success: function (data) {
$('.ViewPkgPopup').html(data);
}
});
});


}
thand Add this code in your controller

public function ViewVisaPopup()
{
$visaId = $this->input->post("visaId");
//$visabanner = $this->input->post("visaBr");

$where =array("visaId" => $visaId);
$row = $this->crud_model->fetch_singleobj('*','country_visa',$where);

echo ' <div class="modal-dialog" style="width:45%">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="myModalLabel">'.$row->visaName.'</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="img1 col-lg-12">
<img src="visa/'.$row->countryBanner.'" width="100%" alt="">
</div>
</div>
<br>
<div class="row">
<div class="col-lg-8 col-md-8 col-sm-8 col-xs-12">
<form action="" class="form-horizontal">
<div class="form-group">
<label for="" class="col-lg-5 col-md-5 col-sm-5 col-xs-12">Your Name</label>
<div class="col-lg-7 col-md-7 col-sm-7 col-xs-12">
<input type="text" name="name" id="name" required="required" class="form-control">
</div>
</div>
<div class="form-group">
<label for="" class="col-lg-5 col-md-5 col-sm-5 col-xs-12">Email</label>
<div class="col-lg-7 col-md-7 col-sm-7 col-xs-12">
<input type="email" name="email" id="email" class="form-control">
</div>
</div>
<div class="form-group">
<label for="" class="col-lg-5 col-md-5 col-sm-5 col-xs-12">Contact No</label>
<div class="col-lg-7 col-md-7 col-sm-7 col-xs-12">
<input type="text" name="phone" id="phone" class="form-control">
</div>
</div>
<input type="button" name="bookNow" value="Book Now" class="btn btn-success bookNow" onclick="send_package('.$row->visaId.')" >
</form>
</div>
</div>
</div>
</div>
</div>';
}
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900