Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

Search the archives!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • From: walter at torres.ws (Walter Torres)
  • Subject: [Javascript] in response to "add a new entry in a drop down menu"
  • Date: Wed Jun 25 01:25:04 2003

FiestaNot 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@xxxxxxxxxx
[mailto:javascript-bounces@xxxxxxxxxx]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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.LaTech.edu/pipermail/javascript/attachments/20030625/951da09b/attachment-0001.html