Enable / Disable textbox controlled by drop-down menu

Sam81

New member
Local time
Today, 20:24
Joined
Mar 10, 2009
Messages
9
Hi Guys,

I have a drop down box that contains different IT asset types eg. mouse monitor and software etc. entry which was retrieved from a db table. How can I code that If the option selected from the drop-down menu is software, enable the no. of licenses text box, if not, disable it.

below are a few i tried but didn't work:

<SCRIPT language=javascript>
function BOHAREA ()
{
if (TIOFORM.DropdownList4.selectedIndex != 'Waiting on BoH area')

TIOFORM.DropdownList6.disabled = false;
else
TIOFORM.DropdownList6.disabled = true;

}
</SCRIPT>


<SCRIPT language=javascript>
function BOHAREA ()
{
if (TIOFORM.DropdownList4.selectedIndex.text != 'Waiting on BoH area')

TIOFORM.DropdownList6.disabled = false;
else
TIOFORM.DropdownList6.disabled = true;

}
</SCRIPT>


<SCRIPT language=javascript>
function BOHAREA ()
{
if (TIOFORM.DropdownList4.vaule = 'Waiting on BoH area')

TIOFORM.DropdownList6.disabled = false;
else
TIOFORM.DropdownList6.disabled = true;

}

Thanks Guys
 
This really should not be in the FORMS category as this is not an Access form. You should be posting these questions in the appropriate category in the Web Design and Development categories.
 
Hi Bob,

I'm using Access Data Page to create my form. Happy to remove it if you like and post it on Wed Design
 
Hi Bob,

I'm using Access Data Page to create my form. Happy to remove it if you like and post it on Wed Design

It is just that it isn't an Access form. It is a web page and I think it would be better to be in a category that would be more applicable. We don't deal with Data Access Pages much, especially in these categories, as they didn't catch on much and have now been deprecated by Microsoft and are no longer in Access versions (starting in 2007).

As for the original question - make sure that your combo is returning what you think it is so that you can code the IF statement properly. It might not be returning what you think it should so then it isn't going to match up with your test to see what it is.
 
Thanks Bob,
I'll repost it on the Web Design forum.
Sad to know that MS will no longer have DAP. I just started using it and it's been very helpfull with our database management.

Thanks again
 

Users who are viewing this thread

Back
Top Bottom