Closed (won't fix)
Project:
Content Construction Kit (CCK)
Version:
5.x-1.6-1
Component:
General
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
19 Mar 2008 at 05:23 UTC
Updated:
9 Jun 2010 at 13:26 UTC
Hi,
I have PHP code for the "Allowed values list" that grabs some values from the database. The widget type is set to: Text Field With Autocomplete, but even if I try to submit a value that should be allowed by the code, I get a "Illegal value for [my fieldname]." message.
To test to see what values the PHP code is generating, I changed the widget to "Select list", and it did show the value I entered in the select dropdown box.
Can anyone please help? I'm really stuck.
Comments
Comment #1
tj2653 commentedIf it helps, my PHP code looks something like this (without the PHP tags):
Again, I do get the correct allowed values populated when I use a select list, but it doesn't seem to work when I enter one of the values as a "Text Field With Autocomplete".
Thanks.
Comment #2
webpoga commentedThis will solve your problem:
I tried simulating your problem and it also gives me the same error message. What we miss here is that the array that should be returned must also have keys. It uses the 'key' as some sort of a selector when reading the array. Thinking about what might have caused the error, I also tried entering '0', '1' in the field, and I successfully submitted the form and it displays the correct values.
:) sorry for a late response.
Comment #3
tj2653 commentedHi webpoga,
Thank you so much!! That seems to work great.
-tj2653
Comment #4
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #5
rvarkonyi commentedHi!
I'm having a similar problem and hopefully you'll be able to help! I'm using Text field with autocomplete too.
If I get it right, this code concentrates on building the allowed values list based on a different table. What I'd like to achieve is have drupal get the values from the field's own allowed values list. The main target I want to achieve is I don't want the module to check the values ALREADY entered and submitted to a table, I want it to use the field's own allowed values list to generate the autocomplete options. Is that something you could help me with?
Thanks!
Rob
Comment #6
karens commentedClosing old issues. None of us is using the D5 version any more, so hard to provide any support. Sorry.