473,372 Members | 1,269 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,372 software developers and data experts.

editable drop-down list


I would like to have an editable DropDownList in my ruby on rails application. The user should be able to select a value from the list of choices, or type in a new value (in one of the empty options in the list of choices) if no predefined choice is applicable.

I tried the { :include_blank => 'True'} option but it just provides a blank option included with a set of options for the drop-down list. Here is my code:

<%= collection_select(:snapshot_view, :id, SnapshotView.find(:all, :select => 'DISTINCT your_machine_name '),
:your_machine_name , :your_machine_name,{ :include_blank => 'True'}) %>

I tried to find ways to make blank option editable, but may be i am going in the wrong direction.

Any help regarding this topic is greatly appreciated.
Aug 8 '07 #1
3 10440
Maybe you can try the code for COMBOBOX in HTML. It is an Editable DropDown Listbox with any one select option as Editable (like a textbox ) and the rest as readonly. You can find it here: chakrabarty.com/combobox.html
Jul 19 '08 #2
16,027 Expert Mod 8TB
Welcome to Bytes and thanks for posting.

I've removed the links to your site. Posting multiple links in that manner is not advisable. Please read the posting guidelines.

Your solution is JavaScript based and doesn't really bring Ruby/Rails into the picture, though it is of course solved with JavaScript alone.
Jul 20 '08 #3
303 Expert 100+
As far as I know, Rails doesn't have a combo box. So you might have to use a JavaScript solution.
Jul 28 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

by: ANC | last post by:
hi, i would like to ask how can i set a field of recordset to be editable? thanks in advance. ANC
by: black tractor | last post by:
HI there.. l was just wondering, if l place a "table" in the "editable region" of my template, will the text, graphics placed inside the this "table" MOVE BY ITSELF?? l mean, recently l had a...
by: David Winter | last post by:
I have a particular application that requires reordering objects by drag and drop, and I would like to do this with a web frontend. To be more precise: There are headlines and paragraphs stored...
by: deko | last post by:
SELECT tblTxAcct.TxAcctName, tblTxType.TxTypeName, Nz(qryTxAcctListCt.TxCount, 0) AS TxCt FROM (tblTxAcct INNER JOIN tblTxType ON tblTxAcct.TxType_ID=tblTxType.TxType_ID) LEFT JOIN qryTxAcctListCt...
by: Stephan Bour | last post by:
Hi, I have a datagrid databound to a SQL query. I'd like to allow editing of some columns but not all. Is there a way to turn off the conversion of the datagrid cells to textboxes for some columns...
by: Hako | last post by:
Hello All, I have a function to set readonly or editable of a textctrl. I'd like to make the textctrl initial set readonly and use other event funciton to set editable of the textctrl but it...
by: Luke | last post by:
Hi! I am new to PHP but I am a very experienced in Perl/CGI/templates. I work in medical informatics when we deal with very large data collection forms. Some of them have over 1000 elements!...
by: planetthoughtful | last post by:
Hi All, I have a web page that presents records in a table, with one row per record. I'd like to put an edit button next to each record, such that if a user clicks on the edit button next to...
by: muchinger | last post by:
All, I create 2 combo boxes on a page: an editable one and a non-editable one. Both of them have the same string items which are too long to entirely fit into the combo box. E. g. the size of...
by: sahista | last post by:
Hello. I create an iframe on the fly, set it to editable designMode='on' and insert into iframe.contentWindow.childNodes.childNodes some innerHTML. Ok... that all works fine in IE but in...
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.