I am quite new in cakephp, first i would tell what i am making and where i am facing problem, Basically iam working on the report card system for this one, i am making a form where we can add the class name, session year and the no of the section and its name, for the session we have used javascript datepicker, and for adding the name of the section i have used ajax.
My controller class is addclasses_controller.php
<?php
class AddclassesController extends AppController
{
var $name='Addclasses';
var $helpers = array('Html', 'Javascript', 'Ajax');
var $components = array('Auth', 'RequestHandler');
var $uses=array('Addclass','User');
function add()
{
$this->layout = 'internal';
debug($this->data);
}
function addsection()
{
$noofsection=$this->data['Addclass']['section'];
$this->set('noofsection',$noofsection);
}
}
?>
and the model class name is addclass.php
and in the the view section, the add.ctp
<table cellpadding="0" cellspacing="0" width="100%">
<tr><td colspan="3">Add Class</tr>
<tr><td colspan="3"></tr>
<?php echo $form->create('Addclass', array('url' => array('controller' => 'addclasses', 'action' => 'add'))); ?>
<tr><td> </td><td> </td><td> </td></tr>
<tr><td>Class Name</td><td></td><td><?php echo $form->text('classname',array('class' => 'users')); ?></td></tr>
<tr><td> </td><td> </td><td> </td></tr>
<tr><td>Session Calender</td><td><input type="text" name="data[Addclass][sdate]" id="AddclassSdate" size="13" datepicker="true" datepicker_format="DD/MM/YYYY" value="<?php echo date('d/m/Y'); ?>"></td><td><input type="text" name="data[Addclass][edate]" id="AddclassEdate" size="13" datepicker="true" datepicker_format="DD/MM/YYYY" value="<?php echo date('d/m/Y'); ?>"></td></tr>
<tr><td> </td><td> </td><td> </td></tr>
<tr><td>The Number of Section which you want to add</td><td></td><td><?php echo $form->text('section',array('class' =>'users')); ?></td></tr>
<?php echo $ajax->observeField( 'AddclassSection',array('url' => array('controller'=>'addclasses', 'action' =>'addsection'),'frequency' => 0.2,'onChange'=>true,'update'=>'employers'));?>
<tr><td> </td><td> </td><td> </td></tr>
<tr><td colspan="3">
<div id="employers"></div></td></tr>
<tr><td colspan="3" ><?php echo $form->end('Submit');?></td></tr>
</table>
and the addsection.ctp
<table cellpadding="0" cellspacing="0" width="80%" align="center">
<?php for($i=1; $i<=$noofsection; $i++)
{
$section="AddclassSec".$i;
$arr="sec".$i;
$section_name ="data[Addclass][$arr]";
?>
<tr><td>Section-<?php echo $i?></td><td></td><td><input type="text" id="<?php echo $section ?>" value="" class="users" name="<?php echo $section_name ?>"/></td></tr>
<tr><td colspan="3"> </td></tr>
<?php
} ?>
</table>
when i the submit the data and check and print the data in mozila, i don,t find session calender data and the name of the section, but in IE7 it is working properly.please solve this problem , i really need this things in projects