Re: Validate a multiple select in cakephp 3.0

2015-02-27 Thread Cake Developer
I see cakephp 3.0 has same multiple select validation but I am getting error Array to string conversion here is what I tried -notEmpty('input_field', __('Please select option(s)')) -add('input_field', [ 'multiple'=[ 'rule'=['multiple', ['min'=1]], 'message'='Please select option

Validate a multiple select in cakephp 3.0

2015-02-27 Thread Cake Developer
Hello Experts, We have multiple select validation in cakephp 2.x public static function multiple($check, $options = array(), $caseInsensitive = false) { .. } any idea what is equivalent validation in cakephp 3.0 ? Thanks -- Like Us on FaceBook https://www.facebook.com/CakePHP Find us

Re: Validate a multiple select in cakephp 3.0

2015-02-27 Thread José Lorenzo
What field are you trying to validate? On Friday, February 27, 2015 at 2:02:00 PM UTC+1, Cake Developer wrote: I see cakephp 3.0 has same multiple select validation but I am getting error Array to string conversion here is what I tried -notEmpty('input_field', __('Please select option(s

Re: Validate a multiple select in cakephp 3.0

2015-02-27 Thread Cake Developer
wrote: What field are you trying to validate? On Friday, February 27, 2015 at 2:02:00 PM UTC+1, Cake Developer wrote: I see cakephp 3.0 has same multiple select validation but I am getting error Array to string conversion here is what I tried -notEmpty('input_field', __('Please select

Re: Issue with multiple select form input.

2012-04-17 Thread Owlio
to search for multiple brands? On Monday, April 16, 2012 4:48:04 AM UTC-7, Owlio wrote: Hi, I hope someone can shed some light on this, it's driving me crazy. I have a multiple select list with options generated from a database. The problem is that the select name is being set

Re: Issue with multiple select form input.

2012-04-17 Thread jeremyharris
, I hope someone can shed some light on this, it's driving me crazy. I have a multiple select list with options generated from a database. The problem is that the select name is being set, incorrectly, as follows: name=data[Server][brand][] When it should be: name=data[Server][brand

Issue with multiple select form input.

2012-04-16 Thread Owlio
Hi, I hope someone can shed some light on this, it's driving me crazy. I have a multiple select list with options generated from a database. The problem is that the select name is being set, incorrectly, as follows: name=data[Server][brand][] When it should be: name=data[Server][brand

Re: Issue with multiple select form input.

2012-04-16 Thread jeremyharris
to search for multiple brands? On Monday, April 16, 2012 4:48:04 AM UTC-7, Owlio wrote: Hi, I hope someone can shed some light on this, it's driving me crazy. I have a multiple select list with options generated from a database. The problem is that the select name is being set, incorrectly

Re: How to validate hasAndBelongsToMany multiple-select?

2011-11-21 Thread phpMagpie
If you're using the core 'multiple' validation rule then I was involved in many discussions about this some time back, the following search should provide all the reading you require: https://groups.google.com/forum/#!searchin/cake-php/validate$20multiple$20rule HTH, Paul. -- Our newest site

How to validate hasAndBelongsToMany multiple-select?

2011-11-20 Thread Mattia Manzati
I all, I'm trying to use the multiple validation method, but it seems that it doesn't works... This is my model: https://gist.github.com/1380696 Thanks in advance for any help! ^^ -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP

Re: multiple select box. automagic form helper problem

2011-09-21 Thread WebbedIT
Robert, No, there is no bug, what you're trying to achieve has nothing to do with saving data. You're creating a control mechanism where a checkbox designates if an action should be performed on a row or not. Cake has no built in functionality to deal with this. One way to achieve what you want

multiple select box. automagic form helper problem

2011-09-20 Thread rockbust
I just can not figure this out. Read the book http://book.cakephp.org/#!/view/1390/Automagic-Form-Elements in my user_index view I am looping through the results of the find(all). for each pass of the foreach I want to set a checkbox so I can mass select each user_id. I can not get the multiple

Re: multiple select box. automagic form helper problem

2011-09-20 Thread Jeremy Burns | Class Outfit
A checkbox only holds true or false, but you are trying to store the user id in it. I'd change it to a 'selected' field and then inspect $this-data for array keys where 'selected' = true. I'd retain your user id field too (as a text field) otherwise you won't know the ids of the selected rows.

Re: multiple select box. automagic form helper problem

2011-09-20 Thread rockbust
Hi Jeremy, Thank you so much for the reply. I kind of got it working. after searching some old posts it seems it is a possible bug with the security component.

How to make Groups in Multiple Select box

2011-04-20 Thread Mr.Jayesh
Hi Mates, Hope baking is in full swing. I am coding a multi select box for categories. I am using Tree Behavior for categories. The thing I am up to is I don't want to allow users to select top categories in the list. I mean the category is displayed as an hierarchy, but I dont want the users to

Re: How to make Groups in Multiple Select box

2011-04-20 Thread cricket
On Wed, Apr 20, 2011 at 12:05 PM, Mr.Jayesh jayeshach...@gmail.com wrote: Hi Mates, Hope baking is in full swing. I am coding a multi select box for categories. I am using Tree Behavior for categories. The thing I am up to is I don't want to allow users to select top categories in the list.

Re: HABTM Multiple Select

2011-04-12 Thread ojonam
Hi, that seems a bit weird to me at first look, because I am using HABTM relations, and edit functions created by the bake tool, and I have my items selected, without having had to do anything more. Perhaps if you could paste the relevant lines from your edit controller and view, somebody here

Re: HABTM Multiple Select

2011-04-11 Thread ojonam
Hi, this might in fact be nothing more than a browser issue. Do you have any html debugging tool like Firebug etc? If so, inspect the html for the select box and verify that some of the options have value selected or similar. Hope this helps. Cheers, ojonam -- Our newest site for the

Re: HABTM Multiple Select

2011-04-11 Thread creat1v1ty
to the Edit view for one of my controllers. I need to know how to get the options/answers associated to a multiple select list to be selected by default. Thanks! On Apr 11, 9:46 am, ojonam manojo10...@gmail.com wrote: Hi, this might in fact be nothing more than a browser issue. Do you have any

HABTM Multiple Select

2011-04-08 Thread creat1v1ty
- Pool - Street It's possible, however, that each Listing can have multiple Views. Here is where I'm having a problem... There are 3 tables total: - listings - propviews (id, name) - listings_propviews (listing_id, propview_id) On the edit view I have a multiple select box, which is pulling

Re: RE: HABTM w/ Multiple Select type Field and saveAll() on multiple records.

2011-02-11 Thread OldWest
Thanks for all of the comments. But nothing seems to be resolving this. I posted my code for the View, Controller and Model w/ a debug() dump. I am able to insert a single record just fine, but when it comes to adding multiple records, the index in the array becomes numerical and it needs to

Populates Multiple Select but does not save selects

2011-02-11 Thread John H.
Hi all, I am working on a project for a client and had a programmer create the app. Funding is out so I am taking over the project myself and have little/no knowledge of cakePHP (I have used codeIgniter instead). I am having problems getting a multiple select to work. Can someone help

Re: Populates Multiple Select but does not save selects

2011-02-11 Thread ShadowCross
and had a programmer create the app. Funding is out so I am taking over the project myself and have little/no knowledge of cakePHP (I have used codeIgniter instead).  I am having problems getting a multiple select to work. Can someone help? The multiple select shows up on the page as directed

Re: HABTM w/ Multiple Select type Field and saveAll() on multiple records.

2011-02-10 Thread ShadowCross
I just saw your other post on this same subject. per the CakePHP Book (http://book.cakephp.org/view/1031/Saving-Your- Data): saveAll(array $data = null, array $options = array()) Used to save (a) multiple individual records for a single model or (b) this record, as well as all associated

Re: Is this possible w/ CakePHP? Using HABTM insert of multiple records/rows (with multiple select box)

2011-02-10 Thread ShadowCross
See my reply to your other post on this same issue (HABTM w/ Multiple Select type Field and saveAll() on multiple records.) On Feb 9, 9:21 pm, OldWest ja...@jasonwydro.com wrote: Does anyone know if this is possible within the CakePHP framework? http://stackoverflow.com/questions/4950487

Re: HABTM w/ Multiple Select type Field and saveAll() on multiple records.

2011-02-10 Thread Maurits van der Schee
On 02/09/2011 11:10 PM, OldWest wrote: I wanted to know if you have much experience with saveAll() w/ HABTM on a multiple select field? I can get the Zips populated from the plans_zips table (with the below), but I cannot get the zips to save in the HABTM plans_zips table.. ... *?php echo

RE: HABTM w/ Multiple Select type Field and saveAll() on multiple records.

2011-02-10 Thread Krissy Masters
:15 AM To: cake-php@googlegroups.com Subject: Re: HABTM w/ Multiple Select type Field and saveAll() on multiple records. Hi, If you use InnoDB tables in MySQL you can use a transaction: http://deadlytechnology.com/web-development-tips/jquery-cakephp-tips/ This lets you define a for loop and do

HABTM w/ Multiple Select type Field and saveAll() on multiple records.

2011-02-09 Thread OldWest
I wanted to know if you have much experience with saveAll() w/ HABTM on a multiple select field? I can get the Zips populated from the plans_zips table (with the below), but I cannot get the zips to save in the HABTM plans_zips table.. ... *?php echo $this-Form-input('$i.Zip', array(* * 'type

Re: HABTM w/ Multiple Select type Field and saveAll() on multiple records.

2011-02-09 Thread ShadowCross
...@jasonwydro.com wrote: I wanted to know if you have much experience with saveAll() w/ HABTM on a multiple select field? I can get the Zips populated from the plans_zips table (with the below), but I cannot get the zips to save in the HABTM plans_zips table.. ... *?php echo $this-Form-input('$i.Zip

Re: HABTM w/ Multiple Select type Field and saveAll() on multiple records.

2011-02-09 Thread OldWest
Yes. But I am doing this for multiple record entries. In other words, I am adding multiple records at once. -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP

Is this possible w/ CakePHP? Using HABTM insert of multiple records/rows (with multiple select box)

2011-02-09 Thread OldWest
Does anyone know if this is possible within the CakePHP framework? http://stackoverflow.com/questions/4950487/cakephp-multiple-entry-fields-w-saveall-habtm-multiple-records-insert-not-savi -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new

Multiple select

2010-06-17 Thread mirfan
Hi guys, I have three tables categories campaigns campaign_categories -- -- - id id id name name category_id status detail

Re: Multiple select

2010-06-17 Thread John Andersen
Take a look at the CakePHP book at these locations: http://book.cakephp.org/view/1390/Automagic-Form-Elements which explains about the form elements and the automagic functionality of it! http://book.cakephp.org/view/1390/Automagic-Form-Elements#options-options-1394 which explains how your data

Re: Multiple Select Question - Only add choices?

2010-03-04 Thread LunarDraco
:58 am, TimG t...@gurske.com wrote: Hey, I have a multiple select that is being displayed as checkboxes thanks to the array('multiple'='checkbox') code. I need to set it somehow so that users can only select new items. So they can check new checkboxes but not uncheck boxes that are already

Re: Multiple Select Question - Only add choices?

2010-03-04 Thread TimG
Good idea - thanks! 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

Multiple Select Question - Only add choices?

2010-03-02 Thread TimG
Hey, I have a multiple select that is being displayed as checkboxes thanks to the array('multiple'='checkbox') code. I need to set it somehow so that users can only select new items. So they can check new checkboxes but not uncheck boxes that are already checked when the page loads. I figured out

HABTM automagic multiple select

2009-06-14 Thread Andre
Hi Guys can you help: When using Automagic Select on a HABTM I cant get the automagic multiple selct box to show the selected items when I edit a user ( showing saving data works great on add) Tables: Users States User_States Users HABTM States In my controller I have : function add(){

Re: HABTM automagic multiple select

2009-06-14 Thread Andre Gelderblom
Anyone? --~--~-~--~~~---~--~~ 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

Re: HABTM automagic multiple select

2009-06-14 Thread Andre
Nevermind it works nothing wrong with the code shown above it was a problem in my models. 'foreignKey' = 'state_id', 'associationForeignKey' ='user_id', had these mixed up in my model once i fixed that it all worked :) --~--~-~--~~~---~--~~ You

HABTM automagic multiple select

2009-06-12 Thread Andre
Hi Guys can you help: When using Automagic Select on a HABTM I cant get the automagic multiple selct box to show the selected items when I edit a user ( showing saving data works great on add) Tables: Users States User_States Users HABTM States In my controller I have : function add(){

Re: No multiple select. Why?

2009-05-10 Thread rich...@home
If you don't want to add them by hand ever time. I've written a function that will do it for you: http://www.richardathome.com/blog/cakephp-auto-populating-foreign-key-dropdown-fields On May 8, 3:16 pm, brian bally.z...@gmail.com wrote: Did you fetch a list of Users in your controller?

No multiple select. Why?

2009-05-08 Thread GetIT
I want checkboxes displaying all users in my database. For example: In my app some users can add new documents and they can choose which users have the right to see the docs. So in my fileupload form I want to add checkboxes showing all users. But this doesn´t work. In the documentation of

Re: No multiple select. Why?

2009-05-08 Thread brian
Did you fetch a list of Users in your controller? FormHelper can only work with what's already set in your $viewVars. On Fri, May 8, 2009 at 5:34 AM, GetIT david.bruen...@t-online.de wrote: I want checkboxes displaying all users in my database. For example: In my app some users can add new

Re: Multiple Select Issues

2008-11-21 Thread validkeys
I'm not too sure what you mean by having a blank page after submitting the form. Anyways, are you submitting an array of multiple id's? I don't know why your select name is data[Did][id][]. It should just be data[Did][id] echo $form-input('id'); Is this what you are doing? On Nov 21, 12:48 am,

Re: Multiple Select Issues

2008-11-21 Thread natmlt
The blank page is essentially a page with no code at all. No html headers no script no nothing. What it should do is return to the same controller/action and run the debug($this-params); When I do this: echo $form-input('id', array('type' = 'select', 'multiple'='true', 'options' =

Re: Multiple Select Issues

2008-11-21 Thread etipaced
app_controller I had: var $components = array('Auth', 'Acl', 'Security'); If I take out the security component the multiple select works fine. So I guess for now I wont use that component.  I don't know if I found a bug or what but maybe this info will help someone else in the future. On Nov 21, 7

Multiple Select Issues

2008-11-20 Thread natmlt
I have been banging my head against this issue all evening. Hopefully someone might notice a typo or something. I have simplified my form down to nothing in hopes of finding the issue. I also decided to write the form object rather than using the form helper to see if it help me find my bug.

multiple select tags problem

2008-11-17 Thread [EMAIL PROTECTED]
Hi, I have a select field which is output as part a pagination loop, i.e. foreach ($data as $company):? tr ... other data ... td ?php echo $form-input('accountTypeNames', array('onchange' ='this.form.submit()', 'label' = '', 'options' = array

Ajax helper observeField, problem when updating multiple select boxes

2008-02-03 Thread Bram
Hi all, I just started working with the ajax helper, but I'm running into a problem. I've three select boxes, le't's call them foo, bar and baz. I've set up observers to update bar when foo changes and to update baz when bar changes. However, if bar changes due to a change in foo, baz doesn't

Re: Obtain all elements of multiple select

2007-12-10 Thread dandreta
On 6 dic, 19:19, dandreta [EMAIL PROTECTED] wrote: I have an HABTM relation between ModelA and ModelB. In the add view of A, I have created two lists, one with all B elements of the database and other one empty . I pass elements of the first list to the second one with javascript and the

Re: Obtain all elements of multiple select

2007-12-10 Thread dr. Hannibal Lecter
On Dec 9, 4:45 pm, dandreta [EMAIL PROTECTED] wrote: Thanks for your response. But I dont understand how I can do this. Can you explain me, please? Regards I'm assuming you're using javascript for item switching, so setting select.options[index].selected to true would do the trick. There is

Re: Obtain all elements of multiple select

2007-12-09 Thread dandreta
Thanks for your response. But I dont understand how I can do this. Can you explain me, please? Regards On 7 dic, 12:16, Serge Rodovnichenko [EMAIL PROTECTED] wrote: Try to set/reset a 'selected' attribute of OPTION when moving options between two lists. On Dec 6, 9:19 pm, dandreta [EMAIL

Re: Obtain all elements of multiple select

2007-12-07 Thread Serge Rodovnichenko
Try to set/reset a 'selected' attribute of OPTION when moving options between two lists. On Dec 6, 9:19 pm, dandreta [EMAIL PROTECTED] wrote: I have an HABTM relation between ModelA and ModelB. In the add view of A, I have created two lists, one with all B elements of the database and other

Obtain all elements of multiple select

2007-12-06 Thread dandreta
I have an HABTM relation between ModelA and ModelB. In the add view of A, I have created two lists, one with all B elements of the database and other one empty . I pass elements of the first list to the second one with javascript and the second list will contain the B elements that will be

Re: Checkboxes instead of multiple select

2007-11-25 Thread mbavio
Gwoo, the multiple = checkbox is not working for me... I have Cake 1.2 pre-beta revision 5875... Do I have to upgrade to make this technique work? Thanks! Martin On Nov 22, 3:10 pm, Gwoo [EMAIL PROTECTED] wrote: This thread was highjacked by Mr. Gould. Please do not reply to a message and

Re: Checkboxes instead of multiple select

2007-11-25 Thread nate
This feature is only available in the latest SVN version of Cake. On Nov 25, 2:51 pm, mbavio [EMAIL PROTECTED] wrote: Gwoo, the multiple = checkbox is not working for me... I have Cake 1.2 pre-beta revision 5875... Do I have to upgrade to make this technique work? Thanks! Martin On Nov

Re: Checkboxes instead of multiple select

2007-11-22 Thread Gwoo
This thread was highjacked by Mr. Gould. Please do not reply to a message and change the subject. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to

Re: Checkboxes instead of multiple select

2007-11-19 Thread kodienz
Hi there, Im using Cake 1.2.0.5427alpha. Have unsuccesfully tried some of these. What is the best way? Basically just trying to implement it into the following Structure products id product price proposal -- id client_id status products_proposals

Re: Checkboxes instead of multiple select

2007-10-08 Thread tracyfloyd
PROTECTED] wrote: hi Stefan, Is it possible to use checkboxes instead of a multiple select to represent data in a many-to-many relation? I wrote a helper ages ago that does just that, check outhttp://cakeforge.org/snippet/detail.php?type=snippetid=190 hth jon -- jon bennett

Re: Checkboxes instead of multiple select

2007-10-08 Thread R. Rajesh Jeba Anbiah
On Oct 7, 3:00 pm, Jon Bennett [EMAIL PROTECTED] wrote: hi Stefan, Is it possible to use checkboxes instead of a multiple select to represent data in a many-to-many relation? I wrote a helper ages ago that does just that, check outhttp://cakeforge.org/snippet/detail.php?type=snippetid

Re: Checkboxes instead of multiple select

2007-10-07 Thread Jon Bennett
hi Stefan, Is it possible to use checkboxes instead of a multiple select to represent data in a many-to-many relation? I wrote a helper ages ago that does just that, check out http://cakeforge.org/snippet/detail.php?type=snippetid=190 hth jon -- jon bennett w: http://www.jben.net/ iChat

Re: Checkboxes instead of multiple select

2007-10-07 Thread dardosordi
Also there are two great articles in the bakery that will help you: http://bakery.cakephp.org/articles/view/create-multiple-checkboxes-instead-of-a-multiple-select-in-your-views http://bakery.cakephp.org/articles/view/alternative-methods-for-working-with-hasandbelongstomany-associations On Oct

Checkboxes instead of multiple select

2007-10-06 Thread stefanb
Is it possible to use checkboxes instead of a multiple select to represent data in a many-to-many relation? I have a categories table connected to a resources table via a categories_resources table, and have set up the HABTM relations in the two models. Now, in my resource add/edit views, I

Search using values from a multiple select option

2007-06-06 Thread hashkash
Hi! I have a multiple select option where the use can select 1 or more owners. I need to query the database based on the owners selected. There was an article i read http://groups.google.com/group/cake-php/browse_thread/thread/e6321043e861d1c1/cca8f2f008e7fb32?lnk=gstq=select+multiple

Re: Search using values from a multiple select option

2007-06-06 Thread Geoff Ford
a multiple select option where the use can select 1 or more owners. I need to query the database based on the owners selected. There was an article i readhttp://groups.google.com/group/cake-php/browse_thread/thread/e6321043... this is like A or B.What I need is A or B or C or. i.e it depends

Re: Search using values from a multiple select option

2007-06-06 Thread Grant Cox
$owners = array('1','2','3') $equipment = $this-Equipment-findAll( array('Equipment.owner_id'= $owners) ); This will generate WHERE `Equipment`.`owner_id` IN ('1','2','3') which sounds like what you want. --~--~-~--~~~---~--~~ You received this message because

Re: Search using values from a multiple select option

2007-06-06 Thread hashkash
Thanks alot for the help on the OR condtions,but my problem related to the checking the owners is based on the number of owners the user selects.I cant code it directly.Its based on user selection. Any idea? Thanks! Kashyap --~--~-~--~~~---~--~~ You received this

Re: Search using values from a multiple select option

2007-06-06 Thread AD7six
On Jun 6, 9:32 am, hashkash [EMAIL PROTECTED] wrote: Thanks alot for the help on the OR condtions,but my problem related to the checking the owners is based on the number of owners the user selects.I cant code it directly.Its based on user selection. Any idea? don't use an OR and read what

Re: Search using values from a multiple select option

2007-06-06 Thread hashkash
from a multiple select option. Im not using a findAll() but using a query() because when i used the findall()before posting on this group i got a few errors. so im using the query(). Kashyap On Jun 6, 12:37 pm, AD7six [EMAIL PROTECTED] wrote: On Jun 6, 9:32 am, hashkash [EMAIL PROTECTED] wrote

Re: Search using values from a multiple select option

2007-06-06 Thread hashkash
here is a part of the controller code http://bin.cakephp.org/view/486635630 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To

Re: Search using values from a multiple select option

2007-06-06 Thread AD7six
no of owners keep growing as and when they register. The owners are selected from a multiple select option. rhetoricalAnd in what form is that available to you in the controller. do pr ($this-data['Equipment']['owner']); how does that var change when you select 1, 2 or n owners in your form./rhetorical

multiple select

2007-03-22 Thread korcs
Hi, Does anyone can suggest me a good tutorial, how to use the HtmlHelper::selectTag function with multiple selection fields? How can I achieve, that when editing an existing DB entry the multiple select list renders with the current DB values? (I tried first the simple select, but it did

Re: multiple select

2007-03-22 Thread Jon Bennett
Does anyone can suggest me a good tutorial, how to use the HtmlHelper::selectTag function with multiple selection fields? you're surely having a laugh aren't you, this has been the most active topic today! jon -- jon bennett t: +44 (0) 1225 341 039 w: http://www.jben.net/ iChat (AIM):

Re: multiple select

2007-03-22 Thread wralph
From the API: selectTag ( $fieldName, $ optionElements, $ selected = null, $ selectAttr = array(), $ optionAttr = null, $ showEmpty = true, $

SOLVED. Re: Validation problem with multiple select boxes

2007-02-17 Thread Norman
for the tables involved and the vanilla CakePHP validation is presenting the same behavior with multiple select listboxes. If any field does not validate, the multiple selects loose their selected options. Norman On 16 fev, 20:06, Norman [EMAIL PROTECTED] wrote: One thing I am sure about

Re: Validation problem with multiple select boxes

2007-02-16 Thread Norman
this behavior with multiple select boxes. But I was not able to find it. Norman On 16 fev, 12:34, Norman [EMAIL PROTECTED] wrote: I have some views for a model with a mix of fields, two of these --~--~-~--~~~---~--~~ You received this message because you are subscribed

Multiple select selected attributes

2006-10-06 Thread lemp
I have a form in which a multiple select list that represent an HABTM relationship. The select is generated with $html-selectTag() (I started from a baked controller). I've got two problems. First: when a validation error occurs, the $selected array that is passed back to the selectTag function

Re: Multiple select selected attributes

2006-10-06 Thread lemp
Second: when my main item is saved, the HABTM are not. Solved no2: relationship table name was not in alphabetical order (colors_fruits). --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to

Re: Multiple select selected attributes

2006-10-06 Thread Sohei Okamoto
The array constructed by selectTag after submit contains keys as its values, so I believe you can just array_flip() that array for next time, which will have keys as its keys. No need to change the helper. Hope this helps. Sohei --~--~-~--~~~---~--~~ You

Re: Multiple select selected attributes

2006-10-06 Thread lemp
Works fine, but feel a little awkward. I'm still wondering if this a normal behavior. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com

Re: Multiple select and relationship many-to-many

2006-08-19 Thread iceaxe
zonathen wrote: [...] doesn't the many-to-many table name need to be in alphabetic order as such: alphafirst_alphasecond, or areas_events. That's correct. Also, be aware that if you have an underscore (_) in a table name the underscore comes AFTER alphabetic letters. So: images

Re: Multiple select and relationship many-to-many

2006-08-18 Thread zonathen
I'm new to cake but doesn't the many-to-many table name need to be in alphabetic order as such: alphafirst_alphasecond, or areas_events. Maybe that will help :) Z Kenia wrote: Hi.. i have a problem with the multiple select in a relationship many-to-many... my tables: event id_event

Re: selected items in HABTM multiple select

2006-08-07 Thread Jon Bennett
Any thoughts ?? how about adding this function to your app_controller.php function getSelectedItems ($data) { $return = array(); foreach ($data as $row) { $return[$row['id']] = $row['name']; }

Re: selected items in HABTM multiple select

2006-08-07 Thread Olivier Percebois-Garve
You're definitely right. thanks a lot. I should think about it every time I see something recurrent in my code. Jon Bennett wrote: Any thoughts ?? how about adding this function to your app_controller.php function getSelectedItems ($data) { $return = array(); foreach

Re: about multiple select

2006-08-02 Thread ByteDoc
Hi Daniel, For more information about the HTML helper and its functions refer to the API or have a look at the inline documentation of the file html.php (located in cake/libs/view/helpers). Searching for the function selectTag supplies you with the following comment: /** * Returns a formatted

Re: about multiple select

2006-08-02 Thread Daniel King
Thanks. I've only checked the manual, and I fount that it seemed to be for some old edition of CakePHP. There is no description of selectTag, only an example in the Saving hasAndBelongsToMany. The code is:?php echo $html-selectTag('Tag/Tag', $tags, null, array('multiple' = 'multiple')) ? Is

Re: about multiple select

2006-08-02 Thread ByteDoc
Cake is changing everyday, the manual will almost always lag behind the development. This is why the inline documentation/API is more up to date than the manual. As Cake is no finished software, try not to rely on the manual alone, but let the code and the API be your guide as well ;) P.S.: The

about multiple select

2006-08-01 Thread Daniel King
PHP: ?php echo $html-selectTag('Tag/Tag', array(1,3,4), null, array('multiple' = 'multiple'));? Page Source: select name=data[Tag][Tag][] multiple=multiple id=TagTag option value= nbsp;/option option value=0 selected=selected1/option option value=1 3/option option value=2 4/option /select

selected items in HABTM multiple select

2006-07-31 Thread Olivier Percebois-Garve
Is there an elegant way to build the list of selected items to feed the $html-selectTag() in a HABTM relation ??I ended with for instance: $materials_selected_designations = array(); for($i=0; $i sizeof($this-params['data']['Material']); $i++){

Multiple select and relationship many-to-many

2006-07-21 Thread Kenia
Hi.. i have a problem with the multiple select in a relationship many-to-many... my tables: event id_event - int name - varchar areas id_area- int name - varchar events_areas area_id - int event_id - int then, i need to put in the multiple select the areas of the event: add, show, delete