Skip to content Skip to sidebar Skip to footer

Hide A Html Button Based On A If-condition

I have a JSP page which includes a button called 'Download'.I want to hide this button based on a if-condition. The Download button is meant to generate and download PDF onclick of

Solution 1:

Display when list isn't empty:

<% if (!list.isEmpty()){ %>
<button type="button" class="btn bg-red waves-effect" onclick="ExportPdf()">Download</button>  
<% } %>

For example if you fetch list from attribute

ArrayList<String> list = (ArrayList<String>) request.getAttribute("listName");

Post a Comment for "Hide A Html Button Based On A If-condition"