I have a dropdown menu with various options. I would like to create a function where if one of the options is selected, a div on the page becomes populated with a text box.
I am using onchange on the dropdown menu to call in the following function, and am getting the error "'referralMeth' is null or not an object"
function showletterRefbox(form)
{
if(form.referralMeth.value=="Letter in post")
{
document.getElementById('referralMeth_letterRefNo').innerHTML = "Please enter the reference number from your letter: <input maxlength=\"60\" size=\"15\" type=\"text\" name=\"referralMeth_letterRefNo\">";
}
}
any ideas why? I can't figure out how to make it work...what am I doing wrong?
I am using onchange on the dropdown menu to call in the following function, and am getting the error "'referralMeth' is null or not an object"
function showletterRefbox(form)
{
if(form.referralMeth.value=="Letter in post")
{
document.getElementById('referralMeth_letterRefNo').innerHTML = "Please enter the reference number from your letter: <input maxlength=\"60\" size=\"15\" type=\"text\" name=\"referralMeth_letterRefNo\">";
}
}
any ideas why? I can't figure out how to make it work...what am I doing wrong?