Unable to enable a select from an onclick JavaScript from another select

Posted on 2009-02-19
Last Modified: 2012-05-06
When I click on the "SR" select, I want the StatusList select to become enabled and no longer grayed out.  The code below is not doing this though it should I believe.  The select it the Struts html:select.  Anyone have any idea why it is not working?
function selectItemHandler() {

	var slist = document.getElementById('statusList');



<html:select  property="reportType" title="Select Criteria" styleId="sr" onclick="selectCriteriaHandler();">

		  <html:option value="00">Choose</html:option>

		  <html:option value="PT">Vending Totals Report</html:option>

		  <html:option value="CT">Collection Totals Report</html:option>

		  <html:option value="CR">Roving Results Report</html:option>


<html:select styleId="statusList" property="status" title="Select Criteria" styleId="ss" disabled="true">

		  <html:option value="ALL">All Status Codes</html:option>

		  <html:option value="--">Pending</html:option>

		  <html:option value="4">Under Investigation</html:option>

		  <html:option value="1">No Problem</html:option>

		  <html:option value="2">Security Violation</html:option>

		  <html:option value="3Y">Vend Referral</html:option>

		  <html:option value="3N">Collection Referral</html:option>

		  <html:option value="3P">Theft Prevention Referral</html:option>


Open in new window

Question by:jwright9
    1 Comment
    LVL 75

    Accepted Solution


    sets the disabled value to a string
    This string evaluates as TRUE since false is
    0, null, empty string or false

    so remove the quotes


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Foreword (May 2015) This web page has appeared at Google.  It's definitely worth considering! How to Know You are Making a Difference at EE In August, 2013, one …
    In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now