hello i have some problem in showing button, when data exist and data not exist. i want the button show if data exist also data not exist. my current problem right now the button only show when data exist but the button automatically hide when data not exist.

here what i got so far..TQ

<tbody>                              
      <jsp:useBean id="reportList" scope="request" type="List" />
        <%                                                                                           
          Iterator staList = reportList.iterator();
          result out = (result) staList.next();
        %>                                        
           <% if (i!=0){%>
             <input name="search" type="button" id="search" value="Search"  onClick="return onSubmit_Click(document.form,'mfa.action?action=Sta_Report&status=<%=out.getStatusExam()%>');"/>                                                            
         <%} else {%>
              <tr>
                <td colspan="3">data not exist</td>
               </tr>
           <%}%>
    </tbody>
Member Avatar for LastMitch

my current problem right now the button only show when data exist but the button automatically hide when data not exist.

You need to hidden the <input> tags for data not exist to appear.

It should look something like this:

<input type="hidden" name="search" id="search" value="${mfa.action?action=Sta_Report&status=<%=out.getStatusExam()%>}"/> 
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.