473,322 Members | 1,314 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,322 software developers and data experts.

Drop Down Box

This is really a html question but I'm posting it here because it's
related to a php site I'm developing.

I'd like to have a drop-down box (or 'combo box' as it's called in
visual basic) that allows the user to either select from the list *or*
type in whatever other value they desire. In VB and VBA this is referred
to as a Limit to List property.

Is there an equivalent form object in html?

Jul 17 '05 #1
3 10737
On Thu, 04 Dec 2003 11:55:58 -0800, bonehead <se**********@here.org> wrote:
This is really a html question but I'm posting it here because it's
related to a php site I'm developing.

I'd like to have a drop-down box (or 'combo box' as it's called in
visual basic) that allows the user to either select from the list *or*
type in whatever other value they desire. In VB and VBA this is referred
to as a Limit to List property.

Is there an equivalent form object in html?


No; closest you'll get in HTML is a <select> and a separate <input
type="text">.

--
Andy Hassall (an**@andyh.co.uk) icq(5747695) (http://www.andyh.co.uk)
Space: disk usage analysis tool (http://www.andyhsoftware.co.uk/space)
Jul 17 '05 #2


"bonehead" <se**********@here.org> wrote in message
news:3F**************@here.org...
This is really a html question but I'm posting it here because it's
related to a php site I'm developing.

I'd like to have a drop-down box (or 'combo box' as it's called in
visual basic) that allows the user to either select from the list *or*
type in whatever other value they desire. In VB and VBA this is referred
to as a Limit to List property.

Is there an equivalent form object in html?


since it's php it would not be hard to create a little selectAdd function
that creates your <select> and your <input type>

I know it would not be hard 'cause I did it for a site recently. My code,
however, depends on my personal data modeling conventions, so it probably
wouldn't be useful to you. Here are the juicy bits

$query = "select * from $tableName .....

while ($myrow = mysql_fetch_array($ ..... {

echo "<option value=$myrow[0] $selectedVar>";

echo $displayFieldContent; //this is set by an argument to my function,
basically contains another row

echo "</option>\n";

}

echo "</select>";

echo "<br>Or add: ";
echo "<input type=text name=Adding".$entityName.">";
Then my <action> checks for a var named "Adding%" and if it finds one it
does the insert, then puts the mysql_insert_id() into whatever table the
form addresses.
Jul 17 '05 #3
Nope. You can do something like this to kinda mimick the behavior:

<select id="something" onchange="Change(this)" style="width: 200px">
<option id="1">Item 1</option>
<option id="2">Item 2</option>
<option id="-1">Other...</option>
</select>
<input id="something_text" type="text" style="display: none; width: 200px">
<script>

function Change(select) {
if(select.selectedIndex == select.options.length - 1) {
select.style.display = 'none';
var edit = document.getElementById(select.id + '_text');
edit.style.display = '';
edit.focus();
}
}

</script>

When Other is selected, the selection box becomes an edit field. You'll need
something to bring the list back, of course.

Uzytkownik "bonehead" <se**********@here.org> napisal w wiadomosci
news:3F**************@here.org...
This is really a html question but I'm posting it here because it's
related to a php site I'm developing.

I'd like to have a drop-down box (or 'combo box' as it's called in
visual basic) that allows the user to either select from the list *or*
type in whatever other value they desire. In VB and VBA this is referred
to as a Limit to List property.

Is there an equivalent form object in html?

Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: PT | last post by:
I got a form with many text boxes, checkboxes and 3 drop downs. From that 3, 2 are dependant. I can choose one drop down, and the next drop down should display the dependant values of the first...
2
by: ehm | last post by:
I am working on creating an editable grid (for use in adding, deleting, and editing rows back to an Oracle database). I have a JSP that posts back to a servlet, which in turns posts to a WebLogic...
1
by: Dan | last post by:
This is one that has me stumped and I need an expert's input. Any ideas why the values from the second script-generated drop down list isn't recognized by the script to add time values to the...
3
by: Don Wash | last post by:
Hi There! I have a Server-side Drop-down box in ASP.NET (VB) page. What do I do to widen the Drop down box's Pull-Down list's width? I'm not talking about the Drop-down box's width but the box...
2
by: Yoshitha | last post by:
hi I have 2 drop down lists in my application.1st list ontains itmes like java,jsp,swings,vb.net etc.2nd list contains percentage i.e it conatains the items like 50,60,70,80,90,100. i will...
1
by: pmelanso | last post by:
Hello, I have a drop down list which is dynatically loaded from a database and I have a second drop down list that is also dynatically loaded depending on what is selected in the first drop down...
7
by: callawayglfr | last post by:
I am building a database in access where I have a drop down box that relates to a text box, that part I have working but when someone selects information from the first drop down I need it to limit...
8
by: Ed Dror | last post by:
Hi there ASP.NET 2.0 VB & SQL Express Lest take Northwind Categories Products as example I create a table that hold these two together and I create a stored procedure like select ProductID,...
4
by: TycoonUK | last post by:
Hi, As I do not have IE7 on my computer, I was wondering if there is a fault in my CSS Menu when using IE7. Please can someone look at my site - http://www.worldofmonopoly.co.uk and tell me...
3
by: penny111 | last post by:
Hi there, For my application, i need to have 3 drop down lists 1. drop down list of folder names 2. drop down list of documents in the folder selected 3. drop down list of instances of the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
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...
0
isladogs
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 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.