I would like to display a second password input field, based on a Boolean value, read from the database. The code to read from the database is written already, and it works. The issue I have is with conditional display of the list element. I know very little jsp - googled for answers, and came up with the following, witch is not working. code:
<ul>
<li><label for="username">Username</label>
<input type="username" name="username" placeholder="username" required>
</li>
<li><label for="password">Password</label>
<input type="password" name="password" placeholder="password" required>
</li>
<!-- conditional display of a second password field -->
<%
if (@showDoublePasswords == true) {
%>
<li><label for="password">Password 2</label>
<input type="password" name="password" placeholder="password" required>
</li>
<% } %>
</ul>
Try This
<ul>
<li><label for="username">Username</label>
<input type="username" name="username" placeholder="username" required>
</li>
<li><label for="password">Password</label>
<input type="password" name="password" placeholder="password" required>
</li>
<!-- conditional display of a second password field -->
<%
//Remove '@'
if (showDoublePasswords == true)
{
%>
<li><label for="password">Password 2</label>
<input type="password" name="password" placeholder="password" required>
</li>
<% }
%>
</ul>
*
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With