PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, October 21, 2022

[FIXED] Why cakephp FormHelper::input() doesn't create a multiple select input on a hasMany association?

 October 21, 2022     cakephp-2.4, formhelper, has-many     No comments   

Issue

I have a model for which exists some model associations whose hasmay and HABTM.

In the edit view,

<?php echo $this->Form->input('myHABTMModel'); ?>

create a select>multiple input, but

<?php echo $this->Form->input('myHasManyModel'); ?>

create a select input with unique choice.

Why ? It is normal ? I must specify ? Or something is wrong somewhere ?


Solution

Indeed, it must specify the multiplicity in the input method options :

<?php echo $this->Form->input('myHasManyModel',array('multiple'=>'multiple')); ?>


Answered By - Rémi Becheras
Answer Checked By - Clifford M. (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing