Hi all,
I,m trying to add a function that will add a text field only when the other option is selected in a dropdown list.
I'm new to Javascript and your help would be most appreciated.
Many thanks in advance.
Um, have you thought about providing your source code?
What, are people ment to pull code out of our asses?
Buzz PHP Class Library - Web Components Made Easy!
http://www.buzzphp.com/
Apologies... My fault
function addOption(selectbox,text,value )
{
var optn = document.createElement("OPTION");
optn.text = text;
optn.value = value;
selectbox.options.add(optn);
}
addOption(document.drop_list.names_list,”Tom”, “Tommy”);
var names = new Array("Tom","Tommy","Andy,"Mike","Ron","Other");
for (var i=0; i < name.length;++i){
addOption(document.drop_list.names_list, name[i], name[i]);
}
What I wanted to do was add a text field if the "Other" option is selected.
Many thanks in advance
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks