CodeIgniter Forums
Open in a new window - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Open in a new window (/showthread.php?tid=71107)



Open in a new window - kayinja.denis - 07-07-2018

Hello,

I have this code but I'd like the view to open in a new window, I've tried various sources but failed to work

PHP Code:
public function getStudentReport()
 
   {
 
       $schoolorclass $this->input->post('schoolorclass');
 
       $reportfor $this->input->post('reportfor');

 
       if ($reportfor == 'schoolyear') {
 
           if($schoolorclass !='school'){

 
               $this->data['classID'] = $classID $this->input->post('classID');
 
               $this->data['sectionID'] =$sectionID $this->input->post('sectionID');
 
               $this->data['value'] = $value $this->input->post('value');

 
               if($sectionID == 0){
 
                   $this->data['students'] = $this->studentrelation_m->get_student_report_all($value$classID);
 
               }else{

 
                   $this->data['students'] = $this->studentrelation_m->get_studentSection_report_all($value$classID$sectionID);
 
               }
 
               echo $this->load->view('report/student/StudentAdmitted'$this->datatrue);               
            
}else{
 
               echo "<h4 class='text-danger'>'PLEASE SELECT A CLASS!' </h4>";
 
           }



How can i make this view or url (report/student/StudentAdmitted)  to open in a new window

thanks


RE: Open in a new window - kierownik - 07-07-2018

Use the following code in the view
Code:
target="_blank"



RE: Open in a new window - kayinja.denis - 07-07-2018

(07-07-2018, 03:48 AM)kierownik Wrote: Use the following code in the view
Code:
target="_blank"

hey  Undecided Undecided where do you place it.....
please more info


RE: Open in a new window - kierownik - 07-07-2018

where you make the link

https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_link_target


RE: Open in a new window - kayinja.denis - 07-09-2018

(07-07-2018, 07:02 AM)kierownik Wrote: where you make the link

https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_link_target

seriously it doesn't work for me. I use js to send data to other controller 
check here my link 
PHP Code:
function ajaxCall(passData) {
 
       $.ajax({
 
           type'POST',
 
           url"<?=base_url('report/getStudentReport')?>",
 
           datapassData,
 
           dataType"html",
 
           success: function(data) {
 
               $('#load_studentreport').html(data);
 
           }
 
       });