[Javascript] in response to "add a new entry in a drop down menu"

William T. Simmons tsimmons at employmentlawadvisors.com
Wed Jun 25 02:43:55 CDT 2003


FiestaWalter,
I can't speak for Smitha, but I think the concept of "combo box" may differ depending upon the development environment. For instance, I'm assuming you're right about how VB looks at it, but in ToolBook (a not-wildly-dissimilar development tool), a combo box can be editable (like what you're talking about in VB) or non-editable, and when non-editable, the combo box really is just like the SELECT element in HTML. I know what you mean, though, about the terminology - when I first noticed SELECT elements in Web pages, I thought "oh, cool, combo boxes", based upon my experience with ToolBook, although I quickly picked up on the different nomenclature. I always just thought of SELECT elements as being non-(user)editable combo boxes. BTW, Revolution (a Windows/Mac/Unix RAD tool that can produce executables for all three platforms from one source project on any of those platforms) has combo boxes that are just like the ones in ToolBook, i.e., the non-(user)editable ones act like SELECT elements.
Tommy Simmons
Employment Law Advisory Network
www.employmentlawadvisors.com

  ----- Original Message ----- 
  From: Walter Torres 
  To: [JavaScript List] 
  Sent: Wednesday, June 25, 2003 1:25 AM
  Subject: RE: [Javascript] in response to "add a new entry in a drop down menu"


  Not to be too picky, but a SELECT Element in HTML is *not* a combo-box.

  A "combo-box" is a VB Object that lists you, the user-not the developer, create a new item to a pick list by keying the info right a the pick list.

  An HTML SELECT Element does not have that "feature" (Boy! I wish it did!)

  So, your example is nice "one liner", it does not make the SELECT a combo box.

  You really had me excited when I was reading this thread about "dynamically adding an item in a combo-box".

  I was eager to see the solution.

  But alas...

  Anyway, as I said, nice "one-liner"

  jsWalter [still eagerly wishing for a true combo-box]

  So,
    -----Original Message-----
    From: javascript-bounces at LaTech.edu [mailto:javascript-bounces at LaTech.edu]On Behalf Of Smitha Ramaswamy
    Sent: Wednesday, June 25, 2003 12:00 AM
    To: [JavaScript List]
    Subject: RE: [Javascript] in response to "add a new entry in a drop down menu"
    Importance: High


    Hi,

    I have attached a very simple html with JS code that will enable you to add a new element to the combo box.
    I hope this is of some help to you.Do get back to me in case of any queries.

    <HTML>
    <HEAD>
    <TITLE> New Document </TITLE>
    <META NAME="Generator" CONTENT="EditPlus 1.2">
    <META NAME="Author" CONTENT="">
    <META NAME="Keywords" CONTENT="">
    <META NAME="Description" CONTENT="">
    </HEAD>

    <BODY BGCOLOR="#FFFFFF">
    <FORM>
    <SELECT NAME="test">
    <option value="1">one</option>
    <option value="2">two</option>
    </SELECT>

    <SCRIPT LANGUAGE="JavaScript">
         document.forms[0].test.options[document.forms[0].test.options.length] = new Option('three','3')
    </SCRIPT>

    </FORM>
    </BODY>
    </HTML>


    Regards,
    Smitha


------------------------------------------------------------------------------


  _______________________________________________
  Javascript mailing list
  Javascript at LaTech.edu
  https://lists.LaTech.edu/mailman/listinfo/javascript

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20030625/b5e626ce/attachment.htm>


More information about the Javascript mailing list