meeting-room-booking-system / mrbs-code

MRBS application code
Other
124 stars 61 forks source link

select_options not working. #1689

Open jberanek opened 8 years ago

jberanek commented 8 years ago

I am setting up a new MRBS. I have created a custom column in my MySQL database.

When I use: $select_options['entry.name'] = array('123', '456', '789'); the name field gets changed to a dropdown box.

When I use $select_options['entry.cost'] = array('$123', '$456', '$789'); the cost field remains a text box.

What am I doing wrong?

Meeting Room Booking System: MRBS 1.5.0 Database: MySQL 10.1.13-MariaDB System: Windows NT ITC-6394-VM4 6.3 build 9200 (Windows Server 2012 R2 Datacenter Edition) i586 Server time: 4/28/2016 3:22:10 PM PHP: 5.6.20

Reported by: *anonymous

Original Ticket: mrbs/support-requests/966

jberanek commented 8 years ago

What is the type (eg VARCHAR(255)) opf the cost column that you have created?

Original comment by: campbell-m

jberanek commented 8 years ago

VARCHAR(80)

Original comment by: *anonymous

jberanek commented 8 years ago

Any field longer than a certain length, determined by the config setting $text_input_max (default 70), will be treated as a textarea rather than a text input field. The $select_options don't apply to textareas (maybe they should), so either reduce the length of your field to 70 or set in your config file

$text_input_max = 80;

Original comment by: campbell-m

jberanek commented 8 years ago

Bingo, I changed it to VARCHAR(70) and it worked. Somehow I must have missed that. Thanks!

Original comment by: *anonymous