I have created three tables like projects,employees and technologies
and also their respective models in HABTM .
I want to create a form for project by which I can assign many
employees and for different technologies.
So that I have taken a multiselect combobox and a select box for
employees and technology respectively.
I want when I create the project form automatically the employees ids
and the technology id will be saved in their
respective join tables.
I have coded the form lile this
<?php if($id == '') {
echo $form -
>create('Project',array('url'=>array('controller'=>'projects','action'=>'save_project'),'name'=>'project_form','type'=>'file'));
}else {
echo $form ->
create('Project',array('url'=>array('controller'=>'projects','action'=>'update_project','id'=>
$id),'name'=>'project_form','type'=>'file'));
echo $form -> hidden('id',array('value'=>
$id,'style'=>'display:none;'));
echo $form -> hidden('Employee.id',array('value'=>
$employees,'style'=>'display:none;'));
echo $form -> hidden('Technology.id',array('value'=>
$technologies,'style'=>'display:none;'));
}
?>
<?php echo $form->input('Employee.id',array('options'=>
$employees,'label'=>'Employee','class' =>
'post_text_box_address','multiple'=>'multiple','id'=>'status'));?>
<?php echo $form->input('Technology.id',array('options'=>
$technologies,'label'=>'Technology','class' =>
'post_text_box_address','id'=>'status'));?>
and all other fields for the project in the format.
But it does not get saved in the join tables.
Please help.
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
No comments:
Post a Comment