• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Question on Select boxes

 
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a form with select boxes

<select name="mine" size="10">
<option value="4">4</option>
<option value="6">6</option>
<option value="8">8</option>
<option value="2">2</option>
</select>

Now, I want to update the values selected using javascript. How can I do this ? any sample codes appreciated.

Will it be a good idea to add an extra textbox ? Can I make this selectbox[listbox] updatable. Any ideas apprecaited .

Thanks
 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Shreya,

I am not sure what you are trying to do.

Now, I want to update the values selected using javascript. How can I do this ? any sample codes appreciated.

What do you want to update ? You can add new options and delete the options dynamically to/from a select box.

Pavan Keely
 
Shreya Menon
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Pavan,

From my JSP I get th values from the database in this listbox. Now the users should have the ability to "update" the values in this listbox if they want. So ideally they should be able to click on the options in selectbox and edit it.

Any ways this is possible ?

Thanks
 
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
it is fully depends on what you ready to compromise.

1. you use select, and when user clicks on it, you display a popup div with edit element, allowing user to enter the value. When div looses focus, you hide it and chnage the text of the option.

2. you don't use select, but use a div instead to mimic select functionality + little extra, like editing. example:
http://www.devsoftware.com/dhtmlTest/select.html
 
Shreya Menon
Ranch Hand
Posts: 285
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yuriy,

can you give me an example for the first option you said.

Thanks
 
It is no measure of health to be well adjusted to a profoundly sick society. -Krishnamurti Tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic