473,626 Members | 3,392 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 10755
On Thu, 04 Dec 2003 11:55:58 -0800, bonehead <se**********@h ere.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**********@h ere.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_arr ay($ ..... {

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

echo $displayFieldCo ntent; //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".$e ntityName.">";
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="Chang e(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_t ext" type="text" style="display: none; width: 200px">
<script>

function Change(select) {
if(select.selec tedIndex == select.options. length - 1) {
select.style.di splay = 'none';
var edit = document.getEle mentById(select .id + '_text');
edit.style.disp lay = '';
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**********@h ere.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
2458
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 drop down chosed. And I have a submite button to submit all these values to DB. First problem: I cant keep the value of the selected text in the first drop down. It always goes back to the first value. (but the asp site extension changes...
2
11036
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 SFSB and, from there, to the database. On the front end, all cells appear as text fields. However, for certain cells, when the user clicks on the cell, the text field turns into a drop-down field (i.e. Select object), defaulting to the value...
1
2899
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 text boxes? What this script is suppose to do is change the value of a second drop down list based on the selection from the first. Then a value is chosen from the script generated drop down list in the
3
6152
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 that appear when user clicks the drop-down arrow button. Because items in the Drop down list are a little long, user can't see the full thing when they pull down the items from the drop down list.
2
12609
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 select any skill in 1st drop down list then i'll select % of this skill in the 2nd list box , based on the percentage i've selected in the 2nd list box it has to display 2 sets of drop down list boxes at run time one for selecting skill and
1
2496
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 box. This all works fine ... what isn't working is when I selected a different item in the first drop down list I want it to automatically reload the items in the second drop down list. I have a funcation called loadNames that laod the second...
7
2431
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 the second drop down to just the related information. Explaining this is obviously challeging. So I'll try to draw a picture: (drop down 1) Select number --- once selected description is populated in text box (drop down 2) based on first...
8
7568
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, ProductName, CategoryID, from tblCategoryProducts Where (CategoryID = @CategoryID)
4
9285
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 if it works, and if it does not, tell me why it does not work. Thanks.
3
7345
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 document selected (my application uses the BusinessObjects Java Web Services SDK) The 2nd list is dependent on the 1st, while the 3rd list is dependent on the 2nd. In other words, this is what i want my application to do -select a folder from the...
0
8262
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8196
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8701
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8637
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8502
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7192
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5571
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2623
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1507
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.