I have three tables like employees ,projects,technologies all joined
with HABTM . I want a form for project model show that I can assign
many employees for a single Project with a technology.
I have taken a multiselect combo box for employees which selects
multiple employees and forward respective ids,and also a technology in
a select box , also it forwards id. but while I am saving Project the
ids could not save in join tables.
How I can pass the ids and how to save.
Mycode in view file of form
<?php if($id == '') {
echo $form -
>create('Project',array('url'=>array('controller'=>'projects','action'=>'save_project'),'name'=>'project_form','type'=>'file'));
//echo $form->input('id');
}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->input('id');
echo $form->input('Employee.id',array('type'=>'hidden','value'=>
$employees);
echo $form->input('Technology.id',array('type'=>'hidden','value'=>
$technologies);
?>
This was typed for form and other fields are in their own format.
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