...

View Full Version : Combo Boxes - more than 2 boxes possible?



ChLi
11-05-2012, 10:27 AM
Hello together,

is it possible to create more than 2 boxes with the javascript "CUT & PASTE DOUBLE COMBO"? My target is a produktfinder, therefore our visiter have to answer in the first step 4 questions, than he get the right produkt.

It would be nice to hear from you - tanks for help!

Greatings
Chris

Philip M
11-05-2012, 10:58 AM
Not a million miles from here:-

http://www.javascriptkit.com/script/script2/triplecombo.shtml

All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.

felgall
11-05-2012, 07:47 PM
You'd do better to use select lists rather than combo boxes for product selection - that way they have to select a product you actually have rather than being able to type anything they like into the combobox.

Philip M
11-05-2012, 08:18 PM
You'd do better to use select lists rather than combo boxes for product selection - that way they have to select a product you actually have rather than being able to type anything they like into the combobox.

I understood that the questioner desired select lists, which is what the script I mentioned provides.

felgall
11-05-2012, 09:58 PM
I understood that the questioner desired select lists, which is what the script I mentioned provides.

I realise that. The point I was trying to make is that there is a difference between a select list and a combo box. The person asking the question was asking about completelty the wrong form element.

The HTML for a select list and the HTML for a combo box are completely different apart from both having option tags to define the pre-defined options you can select from.

Select List:


<select name="statesel" id="state">
<option value=" " selected="selected"> </option>
<option value="ACT">ACT</option>
<option value="NSW">NSW</option>
<option value="NT">NT</option>
<option value="QLD">QLD</option>
<option value="SA">SA</option>
<option value="TAS">TAS</option>
<option value="VIC">VIC</option>
<option value="WA">WA</option>
<option value="OS">overseas</option>
</select>

Combo Box:


<input type="text" list="state">
<datalist id="state">
<option value="act">
<option value="nsw">
<option value="nt">
<option value="qld">
<option value="sa">
<option value="tas">
<option value="vic">
<option value="wa">
</datalist>

Also they function quite differently (with these examples you'd have to select 'overseas' from the select list if you don't want to select an Australian state whereas with the combo box you'd simply enter the name of the state you are in instead of selecting it). So it is difficult to understand how pople can possibly get the two confused.

Logic Ali
11-05-2012, 10:58 PM
I realise that. The point I was trying to make is that there is a difference between a select list and a combo box. ...
Combo Box:


<input type="text" list="state">
<datalist id="state">
<option value="act">
<option value="nsw">
<option value="nt">
<option value="qld">
<option value="sa">
<option value="tas">
<option value="vic">
<option value="wa">
</datalist> So it is difficult to understand how pople can possibly get the two confused.

The <datalist> tag is new in HTML5, the term "combobox" isn't. The term and its functionality may well have been in long-term use with other languages.

Philip M
11-05-2012, 11:04 PM
I am afraid that I have always considered double combo and multiple (double) select lists as synonyms.

ChLi
11-06-2012, 02:59 PM
Hello again,

thanks for your help.

Philip M: Thanks for your link, i will try it at first with 3 opportunitis for our visitors. Perhaps it is better so, becouse 4 boxes also take extremly much work.

Have a good time.

Philip M
11-06-2012, 04:42 PM
Hello again,

thanks for your help.

Philip M: Thanks for your link, i will try it at first with 3 opportunitis for our visitors. Perhaps it is better so, becouse 4 boxes also take extremly much work.



Yes, extremly much work! :) But perfectly possible of course.

Calvert Tripesi
11-06-2012, 07:18 PM
Hello together,

is it possible to create more than 2 boxes with the javascript "CUT & PASTE DOUBLE COMBO"? My target is a produktfinder, therefore our visiter have to answer in the first step 4 questions, than he get the right produkt.


If you find array-building too imponderable, you could evaluate this script: http://scripterlative.com/files/selectcascade.htm, which in the event that you cannot use a server-side database, lets you use XML blocks to store/retrieve the option data.

felgall
11-06-2012, 09:28 PM
The <datalist> tag is new in HTML5, the term "combobox" isn't. The term and its functionality may well have been in long-term use with other languages.

Yes. HTML 5 is introducing the missing combo box form field into web pages. It has been available in other programming languages used for creating desktop applications since the introduction of Windows 3.0 (from my personal knowledge) and possibly a lot earlier.

The whole reason why it has always been called a combo box is because it COMBINES the functionality of an input field and a dropdown list into a single form field.

When I first started writing web pages back in 1999 the combo box field was one that I could see several uses for but where there was at that time no easy way to implement it. The only way was to display two fields where JavaScript updated the input field if something was selected in the select list. The introduction of the DOM made it possible to use JavaScript to combine an input field and a list to produce a combo box that works with JavaScript enabled and which appears as just an input field when JavaScript isn't available. HTML 5 is finally introducing a way to create a combo box using just HTML - something that should have been added to HTML at the same time the <form> tag was added - since all other languages had combo box elements available to use in forms.

A combo box is DEFINITELY NOT a synonym for a drop down list as a drop down list only provides half the functionality of a combo box.

The term combo box for a combination of input field and dropdown list into a single form field long predates the introduction of the web - it is just that the web hasn't provided an easy way to define a combo box prior to HTML 5.

Philip M
11-06-2012, 09:31 PM
Yes. HTML 5 is introducing the missing combo box form field into web pages. It has been available in other programming languages used for creating desktop applications since the introduction of Windows 3.0 (from my personal knowledge) and possibly a lot earlier.

The whole reason why it has always been called a combo box is because it COMBINES the functionality of an input field and a dropdown list into a single form field.

When I first started writing web pages back in 1999 the combo box field was one that I could see several uses for but where there was at that time no easy way to implement it. The only way was to display two fields where JavaScript updated the input field if something was selected in the select list. The introduction of the DOM made it possible to use JavaScript to combine an input field and a list to produce a combo box that works with JavaScript enabled and which appears as just an input field when JavaScript isn't available. HTML 5 is finally introducing a way to create a combo box using just HTML - something that should have been added to HTML at the same time the <form> tag was added - since all other languages had combo box elements available to use in forms.

A combo box is DEFINITELY NOT a synonym for a drop down list as a drop down list only provides half the functionality of a combo box.

OK, but HTML5 is still some way from implementation and it will be quite a few years before HTML4 browsers are extinct.

felgall
11-06-2012, 09:40 PM
OK, but HTML5 is still some way from implementation and it will be quite a few years before HTML4 browsers are extinct.

As I said, since the introduction of the DOM it has been possible to create a combo box using an input field and a list using HTML 4 - see http://javascriptexample.net/domform11.php

Prior to the introduction of the DOM the closest you could get (for browsers such as Netscape 3 and 4) was to use both an input field and a dropdown list and link them together - http://javascript.about.com/library/blnav7.htm shows how I created combo box fields in web forms back in 2002 through 2005.

I'd been using combo boxes in desktop applications in the early 1990s and so that such an element hasn't existed in HTML prior to HTML 5 is something that I have always found to be annoying - hence the above two solutions that I implemented in my forms.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum