You have two choices, either have a textfield always in the page but hidden until the user chooses 'add a new category' or create a new field from scratch using the DOM and insert it into the page. The first choice is probably easier. You may have to make some changes to support older browsers but this should work on IE and modern Mozilla types. In your list box have an onchange that calls showTextbox(this), I'm assuming the add new is the last choice in the listbox:
Code:
function showTextBox(Listbox)
{
if (Listbox.selectedIndex == (Listbox.options.length - 1))
/*To check on a specific value have if (Listbox.options[Listbox.selectedIndex].value == "<value here>")*/
{
document.getElementById("txtNewCategory").style.display = "";
}
}
In the form have
Code:
<input type="text" id="txtNewCategory" name="txtNewCategory" style="display:none">
--
Joe