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 9002113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T00:31:35+00:00 2026-06-16T00:31:35+00:00

my question is that i want to hide my delete button initially, and as

  • 0

my question is that i want to hide my delete button initially, and as when user mark on checkbox
the delete button keep going on showing up until all the checkbox are not unmarked

this is how i try to do this, the problem i faced when i unmarked the one checkbox my delete button is vanished though my rest of checkbox is marked

    <%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@page
    import="com.nousinfo.tutorial.employee.service.model.bo.EmployeeBO"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<link rel="stylesheet" href="css/style.css" type="text/css"></link>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">


<title>Home</title>

<script type="text/javascript">
    function windowLoadByName(windowHeight, windowWidth) {
        var centerWidth = (window.screen.width - windowWidth) / 2;
        var centerHeight = (window.screen.height - windowHeight) / 2;

        newWindow = window.open(
                'PopUp.jsp',
                'mywindow',
                'resizable=0,width=' + windowWidth + ',height=' + windowHeight
                        + ',left=' + centerWidth + ',top=' + centerHeight,
                "status=1").divHiding(1);
        newWindow.focus();

    }
    function windowLoadById(windowHeight, windowWidth) {
        var centerWidth = (window.screen.width - windowWidth) / 2;
        var centerHeight = (window.screen.height - windowHeight) / 2;
        newWindow = window.open(
                'PopUp.jsp',
                'mywindow',
                'resizable=0,width=' + windowWidth + ',height=' + windowHeight
                        + ',left=' + centerWidth + ',top=' + centerHeight)
                .divHiding(2);

        newWindow.focus();
        return newWindow.name;
    }

    function loadName(name) {

        this.firstName = name;
        window.location = 'http://localhost:8080/EmployeeWeb/GetEmployee?key1='
                + encodeURIComponent(firstName);

    }
    function loadId(id) {

        this.id = id;

        window.location = 'http://localhost:8080/EmployeeWeb/GetEmployee?key2='
                + encodeURIComponent(id);

    }

    function showMe (it, box) { 
      var vis = (box.checked) ? "block" : "none"; 
      document.getElementById(it).style.display = vis;
    } 


</script>

</head>

<body background="transparent">


    <table width="951" height="116" border="0" align="center">
        <tr>
            <td width="661" height="112" bgcolor="#D1D1FF"><font size="6">EmployeeManagement</font>
            </td>
            <td width="266" height="112" align="center" bgcolor="#FFFFFF"><img
                src="image/nous.jpg" alt="1" width="266" height="84" /></td>
        </tr>
    </table>
    <p>&nbsp;</p>


    <table width="949" height="183" border="0" align="center">
        <tr>
            <td height="42" align="center" bgcolor="#3366FF"><strong>Find
                    Employee </strong></td>
        </tr>

        <tr>
            <td width="943" height="43"><input id="findid" name="button"
                type="submit" value="Find_Employee_By_ID"
                onClick="windowLoadById(250,500)" /></td>
        </tr>
        <tr>

            <td height="43"><input id="findname" name="submit2"
                type="button" value="Find_Employee_By_Name"
                onClick="windowLoadByName(250,500)" /></td>
        </tr>
        <tr>
            <td><form id="form2" action="GetEmployee">
                    <input type="submit" name="submit3" value="Get_All_Employee" />
                </form></td>
        </tr>
        <tr>
            <td><form id="form2" action="CreateEmployee.jsp">
                    <input type="submit" name="create" value="CreateEmployee" />
                </form></td>
        </tr>


    </table>

    <p>&nbsp;</p>
    <br>
    <br>
    <div id="div12">
        <form action="UpdateEmployeeServlet">
            <table width="725" border="1" align="center" cellpadding="5"
                cellspacing="5">
                <tr>
                    <th width="118">check</th>
                    <th width="118">EmployeeNumber</th>
                    <th width="118">First Name</th>
                    <th width="118">Last Name</th>
                    <th width="118">Title</th>
                    <th width="118">Address1</th>
                    <th width="118">Address2</th>
                    <th width="118">City</th>
                    <th width="118">Detail
                    <th>
                </tr>
                <c:forEach var="employeeBO" items="${listemployeeBo}">
                    <tr>
                        <td><input type="checkbox" value='${employeeBO.empNumber}'
                            name="checked" onclick="showMe('div1',this)"></td>
                        <td>${employeeBO.empNumber}</td>

                        <td>${employeeBO.firstName}</td>

                        <td>${employeeBO.lastName}</td>

                        <td>${employeeBO.title}</td>

                        <td>${employeeBO.address1}</td>

                        <td>${employeeBO.address2}</td>

                        <td>${employeeBO.city}</td>



                        <td><a href="javascript:loadId(${employeeBO.empNumber})">Details</a></td>

                    </tr>
                </c:forEach>

            </table>
            <div id="div1" style="display:none;">
                <table>

                    <tr>

                        <td><input type="hidden" name="updateStatusDelete" value="D" />
                            <input type="submit" name="delete" value="Delete" /></td>
                    </tr>
                </table>
            </div>
        </form>
    </div>
</body>
</html>
  • 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-06-16T00:31:36+00:00Added an answer on June 16, 2026 at 12:31 am

    Replace your showMe function with this:

    // box is not needed now, it checks all checkboxes to see
    // if any one of them is checked
    function showMe(it, box) {
        var hasChecked = false;
        var chks = document.getElementsByName('checked');
        var vis = '';
    
        for ( var i = 0; i < chks.length; i++ ) {
            if ( chks[ i ].checked ) {
                hasChecked = true;
                break;
            }
        }
    
        if ( hasChecked == false ) {
            vis = "none";
        } else {
            vis = "block";
        }
    
        document.getElementById( it ).style.display = vis;
    }
    

    Hope it helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

this is another question that I want to know that how to apply any
The method in question that I want to use is gem and sourced here
I have a slightly theoretical question that I want to clear up before I
hey, my question is that i want to display the names whose payment type
I want to ask a basic question that I couldn't find in online tutorials.
Hello every one I want to ask a question that what is simple exec
My question is about a specific array operation that I want to express using
This question is sort of a sequel to that question. When we want to
Potentially embarrassing question, but there is obviously something I'm missing that I want/need to
I have a simple question. I have a long std::string that I want to

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.