Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7013795
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T22:26:15+00:00 2026-05-27T22:26:15+00:00

I have written a javascript function. function wellChecked(state) { if (state) { wellDropDown.style.visibility =

  • 0

I have written a javascript function.

function wellChecked(state) {
if (state)
{
wellDropDown.style.visibility = 'visible';
}
else
{
wellDropDown.style.visibility = 'hidden';
}
}

I have a checkbox after the Well Modification <td> as given below,

<tr>
  <td>On Call</td>
  <td><html:checkbox property="onCall"/></td>
  <td>Well Modification</td>
  <td><input type="checkbox" onclick="wellChecked(this.checked)" /></td>
</tr>

When that checkbox is clicked I want the drop down list given under the div id=wellDropDown to be displayed. Defaultly, if the check box is not clicked, the drop down should not be displayed.

<tr>
  <td>Active</td>
  <td><html:checkbox property="active"/></td>
<div id="wellDropDown" style="visibility:hidden;">
  <td>     
    <html:select property="wellFormatId">
    <html:option value="">(Select)</html:option>
    <bean:define id="wellFormatColl"  name="wellFormats" scope="request"/>
    <logic:iterate id="wellFormats" name="wellFormatColl" indexId="index" type="com.astrazeneca.compis.data.WellFormatVO">
        <% Long wellId = wellFormats.getWellFormatId();%>
        <% String wellIdNo = wellId.toString(); %>
        <html:option value="<%=wellIdNo%>">
        <bean:write name="wellFormats" property="wellFormatName"/>
        </html:option>
    </logic:iterate>
    </html:select>
  </td>
 </div>
</tr>

When I tried executing this code, I could see the drop down list getting displayed irrespective of the checkbox checked or not.

Where I have went wrong in this scenario? Please give ur suggestions or ways to implement my requirement.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T22:26:16+00:00Added an answer on May 27, 2026 at 10:26 pm

    Your HTML is invalid. You may not have a div enclose a td like this. Either make the td itself visible or invisible, or put the div inside the td, instead of putting it around the td.

    Also, unless wellDropDown is a global JS variable, the code should be

    document.getElementById("wellDropDown").style.visibility = 'visible';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written a javascript function that uses setInterval to manipulate a string every
I am trying to call a javascript function onclick. I have written something like
I have this written in a certain Javascript function. document.getElementById(textbox).innerHTML = some text; This
I have written a javascript to generate textbox dynamically. Code: function addtextbox(val) { var
I have written a function using javascript for validating a Date selected from a
i have written one javascript function to retrieve the position of a button and
I have written a javascript that works well in all browser except Internet Explorer
I have always written my JavaScript blocks var functionName = function() { if (someCondition)
I have written one JavaScript function which would rise the event when the User
`I have written a js function to traverse a javascript object and output it's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.