|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Runtime option creation / deletion for select tag
Hi !!
it would be great if you share a piece of javascript code to help me out in this. I need to make a Drop box in which new option may be created or deleted as per flaw. i work a bit for removal runtime options function remove_element(nEleNumber){ var f = document.myform; f.ccode.remove(nEleNumber); // will remove this option element from Select tag } But, how to add new element on desired index.. |
|
#2
|
||||
|
||||
|
simple as that:
Code:
function add_element(nEleNumber, strText, strValue){
var f = document.myform;
f.ccode.add(new Option(strText, strValue), nEleNumber);
}
|
![]() |
| Viewing: ASP Free Forums > Programming > HTML, JavaScript And CSS Help > Runtime option creation / deletion for select tag |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|