I have this code which is called by a combo box, on change event. The text box is called txtCatalogID. I figured out how to get the value but cannot set it in the txtCatalogID.
the form name is
<form Name="myForm" ....>
CatalogID <input type="text" name="txtCatalogID" size="12"><br>
TIA
DougP
Code:
function GetNextCategoryNum(sel)
{
var NextNumber;
var textbox = document.getElementById("txtCatalogID");
var number = parseInt(sel.options[sel.selectedIndex].value);
NextNumber = number + 1;
alert("Last number used " + NextNumber );
textbox.value =NextNumber // this does not work
document.getElementById("txtCatalogID") =NextNumber // nor this does not work
document.getElementById("txtCatalogID").value = NextNumber // nor this does not work
}
<form Name="myForm" ....>
CatalogID <input type="text" name="txtCatalogID" size="12"><br>
TIA
DougP