//flex table opened by JP

Click to See Complete Forum and Search --> : New Select Option / Javascript


Dragonjucr
04-08-2003, 12:02 PM
Ok, I am looking to add a new option via javascript? Basically, I want to have a combo box (select option) with an option value of "Not Listed"

Then I have a Javascript function onChange to check the selected value - if "Not Listed" , then I show a prompt dialog which then I want to assign it's value to the combo Box (select option) as well as it's caption?

Anyone have any ideas?

Thanks!

Dragonjucr
04-08-2003, 01:15 PM
I GOT IT! THANKS ANYWAY.

function CheckSelected(value) {
if (value!="Not Listed") {document.frmEquipIssue.cmboEquipment.value = value;};
else {
strNewOption = prompt("Please enter in the type of handset below.","LG VX 3100");
document.frmEquipIssue.cmboEquipment[25] = new Option(strNewOption, strNewOption, false, true);
//alert(document.frmEquipIssue.cmboEquipment.value);
}

}, strNewOption, false, true);

DocEvi1
04-08-2003, 05:12 PM
its always great to see people solve their own problems, even better when you post the solution as well.

for future javscript's check out javscript.internet.com (http://javascript.internet.com). I found it quite useful.

Stefan