Welcome Guest, Not a member yet? Register   Sign In
Help please my javascript is not working in CI..
#1

[eluser]kit005[/eluser]
I'm a newbie in codeigniter, my problem is the javascript it doesnt work in Ci though my css goes well in it.. I just cant find my mistake.. Hope somebody can help me.. I appreciate it so much..

My home page
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> &lt;html&gt; &lt;head&gt; &lt;base href="&lt;?php echo base_url();?&gt;" /&gt; &lt;title&gt;My Page&lt;/title&gt; &lt;meta http-equiv="Content-Language" content="English" /&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;
[removed][removed]
[removed][removed]
[removed][removed]
[removed][removed]
[removed][removed]
&lt;link rel="stylesheet" type="text/css" href="&lt;?php echo base_url();?&gt;css/stylered.css" media="screen" /&gt;
&lt;link rel="stylesheet" type="text/css" href="&lt;?php echo base_url();?&gt;button.css" media="screen" /&gt;
&lt;/head&gt;
&lt;body&gt;
<div id="centered">
<div id="wrap">
<div id="header">
    <img src="/demo/images/headerred.jpg" width="82%" heigth="20%" />
</div>
<div id="top"> </div>
<div id="content">
<div>
<div id="box">
<br /><br />
<br /><br />
<br /><br />
       <table width="420">
           &lt;form method="GET" id="myform" name="myform"&gt;
            <tr>&lt;?php echo form_open('educ/view2'); ?&gt;
              <td width="420" height="15" align="center">
               <p>
               &lt;input type="text" id="contractno "name="contractno" maxlength="7" size="25" class="form" autofocus="autofocus"/&gt;
               </p>
              </td>
            </tr>
       </table>
       <br />
       <div>
       <table id="table">
            <tr>
               <td width="413" height="35" align="center">
               &lt;input name="submit" id="submit" type="image" src="&lt;?php echo base_url();?&gt;images/submit2red.png" width="30%" heigth="15%" value="submit" /&gt;
               &lt;?php echo form_close(); ?&gt;
               </td>
            </tr>
            &lt;/form&gt;
       </table>
       </div>
    </div>
</div>
<div>
</div>
</div>
<div id="bottom">
</div>
<div id="footer">
</div>
</div>
&lt;/body&gt;
&lt;/html&gt;


My root derictory
+system
+application
-views
-index
-view2
-display
-display2
-controller
+index
+js
-function
-jquery
-js_lib
-soon
+css
-style.css
-stylerd.css


My problem is, when the user inputs it doesnt fetch the data and direct to the other page, it remain just in that page..

My controller

Code:
&lt;?php
class educ extends CI_Controller
{
public function __construct()
{
  parent::__construct();
  $this->load->helper(array('form', 'url'));
  $this->load->library('javascript');
  $this->load->model('educ_model');
}
public function index()
{
  $data['library_src'] = $this->jquery->script();
                $data['script_head'] = $this->jquery->_compile();
  $this->load->view('educ/index');
  
  /*if(count($queryr['details'])==0)
  {
   echo "[removed]alert('Enter Contract Number');[removed]";
  }*/
  
}

public function view2()
{
  session_start();
  $_SESSION['contractno'] = $_REQUEST['contractno'];
  $queryr['details'] = $this->educ_model->educplan($_SESSION['contractno']);
  
  if(count($queryr['details'])>0)
  {
   $this->load->view('educ/view2', $queryr);
  }
  
  
  else {
   echo "[removed]alert('No Record found');[removed]";
   $this->load->view('educ/index');
  }
  
  
  
}

public function display()
{
  session_start();
  $cno = $_SESSION['contractno'];
  /*$_SESSION['sname'] = $_REQUEST['sname'];
  $_SESSION['fname'] = $_REQUEST['fname'];
  $_SESSION['mi'] = $_REQUEST['mi'];
  $_SESSION['dob'] = $_REQUEST['dob'];
  $_SESSION['contractdate'] = $_REQUEST['contractdate'];*/
  
  $queryr['details'] = $this->educ_model->educplan($cno);
  $this->load->view('educ/display', $queryr);
}

public function display2()
{
  session_start();
  $cno = $_SESSION['contractno'];
  
  $_SESSION['neweadd'] = $_REQUEST['eadd'];
  $_SESSION['newcpnum'] = $_REQUEST['cpnum'];
  $_SESSION['newcpprefix'] = $_REQUEST['cpprefix'];
  
  $queryr['details'] = $this->educ_model->educplan($cno);
  $queryr['beneficiary'] = $this->educ_model->beneficiary($cno);
  //print_r($queryr);
  $this->load->view('educ/display2', $queryr, $_SESSION);
}

public function save()
{
  session_start();
  $cntno = $_SESSION['contractno'];
  $educdata = array(
                        
                        'cpprefix' => $_SESSION['newcpprefix'],
                        'cpnum' => $_SESSION['newcpnum'],
                        'eadd' => $_SESSION['neweadd']
                        );
  //print_r($educdata);
  $this->educ_model->savechanges($educdata,$cntno);
  echo "[removed]alert('DATA UPDATED!!!');[removed]";
  $this->load->view('educ/cert');
  
}
}

It works well in php but when i transfer it in CI i got a hard time.. :down:


Messages In This Thread
Help please my javascript is not working in CI.. - by El Forum - 05-02-2012, 12:49 AM
Help please my javascript is not working in CI.. - by El Forum - 05-02-2012, 12:55 AM
Help please my javascript is not working in CI.. - by El Forum - 05-02-2012, 12:58 AM
Help please my javascript is not working in CI.. - by El Forum - 05-02-2012, 01:50 AM
Help please my javascript is not working in CI.. - by El Forum - 05-02-2012, 02:04 AM
Help please my javascript is not working in CI.. - by El Forum - 05-02-2012, 02:08 AM
Help please my javascript is not working in CI.. - by El Forum - 05-02-2012, 02:11 AM
Help please my javascript is not working in CI.. - by El Forum - 05-02-2012, 02:15 AM
Help please my javascript is not working in CI.. - by El Forum - 05-02-2012, 02:17 AM
Help please my javascript is not working in CI.. - by El Forum - 05-02-2012, 07:48 AM
Help please my javascript is not working in CI.. - by El Forum - 05-02-2012, 05:45 PM
Help please my javascript is not working in CI.. - by El Forum - 05-02-2012, 07:23 PM
Help please my javascript is not working in CI.. - by El Forum - 05-03-2012, 12:27 AM
Help please my javascript is not working in CI.. - by El Forum - 05-03-2012, 01:49 AM
Help please my javascript is not working in CI.. - by El Forum - 05-03-2012, 04:03 AM
Help please my javascript is not working in CI.. - by El Forum - 05-03-2012, 11:47 PM
Help please my javascript is not working in CI.. - by El Forum - 05-04-2012, 01:08 AM



Theme © iAndrew 2016 - Forum software by © MyBB