Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 13 of 13
  1. #1
    New Coder
    Join Date
    Nov 2003
    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Basic Editable Combo Box

    http://www.portalaska.com/combo.html

    http://www.portalaska.com/combo.js

    Here is a very basic simulated editable combo box for quick and dirty uses.

    After any text input on a form you simply add a...

    <script>fancycombo("[inputid]combo","[inputid]","[option1]","[option2]","[option3]")</script>

    You must give the input an id as well as a name. They don't have to be the same thing, but its recommended.

    NS broke when I was cleaning up the code. Searching for the error.
    Last edited by SlySecretSpy; 01-29-2004 at 06:10 PM.

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Nashua, NH
    Posts
    1,724
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs down

    Does not work in Gecko
    Vladdy | KL
    "Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"

  • #3
    New Coder
    Join Date
    Nov 2003
    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sweet, I have a major design flaw that I found. Doesn't work in gecko. Positioning is off.
    Last edited by SlySecretSpy; 01-29-2004 at 06:20 PM.

  • #4
    Regular Coder
    Join Date
    Apr 2003
    Location
    Atlanta, GA
    Posts
    487
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Have you tried the TypeAheadCombo class I developed based on some great work by glenngv? It just uses a normal <select> element, and can accept a single new value as the first option.

    Check it out; it may do the trick you're looking for.

  • #5
    Senior Coder
    Join Date
    Feb 2004
    Posts
    1,206
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I haven't done much work with HTC's (Hyper Text Components), but I found a pretty sweet component that does exactly what you're thinking of, but it looks really nice too.

    Here's the link:
    http://www.deadbeef.com/dhtml/combobox.htm

    I'm currently trying to figure out how to incorporate another feature of the select component: the value attribute of each option. When used in a form, this HTC seems to merely pass the value of text in the variable on submit -- treating it just like a textbox.

    I don't know if there is a fix for this, but one would be much appreciated.

    Thanks & Enjoy,
    Sadiq.

  • #6
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    10,966
    Thanks
    0
    Thanked 236 Times in 233 Posts
    The problem with that code is that it only works in IE so it has very limited support. Unlike the update that Choopernickel made in my original work, which has a wider support (IE5+, NS6+, Moz1+ among others)

  • #7
    Senior Coder
    Join Date
    Feb 2004
    Posts
    1,206
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I suppose...

    But I'm currently creating an application for a company that will run on its intranet, and all machines are windows -- hence, all users will use IE to connect to the application.

    In my environment, presentation is very key, and this HTC provides almost exactly what I'm looking for. Except, of course, the fact that it's missing the value attribute...

    But I do see your point. However, if you can guarantee your users will be using IE, this is a very nice option.

    Again, if anyone can figure out how to get the value attribute of the select box to carry through, I'd really appreciate your help.

    Thanks,
    Sadiq.

  • #8
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    10,966
    Thanks
    0
    Thanked 236 Times in 233 Posts
    It is said in the link you posted that you access the value in javascript as:

    name_text.value

    But if you mean, it doesn't pass the selected option value in the server, the html source of that page does specify the value, though the same with the text.

    <form id=form1>
    <DEADBEEF:COMBOBOX size="44" name="server" id=server>
    <option selected value="deadbeef.com">deadbeef.com
    <option value="microsoft.com">microsoft.com
    <option value="sageconspiracy.com">sageconspiracy.com
    </DEADBEEF:COMBOBOX>
    <br><input type=submit>(Look at the url in your address bar after you press submit.)
    </form>

  • #9
    Senior Coder
    Join Date
    Feb 2004
    Posts
    1,206
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I don't get it..

    My problem is that the variable passed over to my php page doesn't hold the value, it holds the text.

    So yea, I'm sure that using Javascript I could see the value, however, once the form is submitted to the server, the variable in the $_POST array holds the text value -- NOT the value.

    Now I'm not sure if you answered my question in your previous post glenngv, but I hope I've made my problem more clear.

    Thanks again,
    Sadiq.

  • #10
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    10,966
    Thanks
    0
    Thanked 236 Times in 233 Posts
    Ok, if that is the case then just create a hidden field that will hold the value of the selected option. Since javascript can access the "value", you can set the value of the hidden field when the submit button is clicked and then in PHP, access that hidden field instead of the combobox itself.

  • #11
    Senior Coder
    Join Date
    Feb 2004
    Posts
    1,206
    Thanks
    0
    Thanked 0 Times in 0 Posts
    glenngv,

    thanks for your short-circuit solutions. However, I'm going to need a proper solution since my application is slightly more complicated (dynamic variables and form elements...), and the short-circuit solutions won't work.

    I've contacted the guy from deadbeef.com to see if he can aid me.

    If anyone else has any experience with HTCs, I'd appreciate your help as well.

    Thanks,
    Sadiq.

  • #12
    Regular Coder
    Join Date
    Apr 2003
    Location
    Atlanta, GA
    Posts
    487
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You have two cares, apparently: functionality and presentation. These are of course good cares to have- yet you must decide which of the two is most important.

    TypeAheadCombo will submit the <option> value, either if it is not enabled to accept new values, or if a new value is not typed. If a new value is typed, there's only one context which must be dealt with: the new <option>'s text, which is set to the same as the value, as the typing happens.

    If your primary concern is a flashing cursor, I'm sure somebody can come up with a way to add one in to the TypeAheadCombo class.

    Here's a quite complex form with TypeAheadCombo in action, and the instantiation is (of course) no more difficult than ever: http://www.10mar2001.com/temp/formUI/index.html . There's no form too complex for this script.

  • #13
    New Coder
    Join Date
    Nov 2003
    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Or, you could code your own and get an education in the proccess. My code barely works in general, but on my IE platform and design it works great. If I have time become available, I'll modify it for cross compliance.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •