0
<body>        
    <%
        out.println(" UserName:<input type=\"text\" id=\"s1\" size=\"10\" name=\"s1 \" > ");

        out.println("Password:<input type=\"password\" id=\"s2\" size=\"10\" name=\"s2\" >");

        out.println("<button onclick=\"Myfunction()\">Submit</button>");
    %>
</body>

This is my Jsp page,when i goes to Password tab ,it has to show mandatory symbol * and text box beside username that field is mandadtory. How can i do this ,anybody guide me please,thanks for your help?

tajMahal
  • 418
  • 6
  • 18
  • 40

1 Answers1

0

You need to add jquery validation and from your code i could see that you are constructing the html page inside your scriptlets . thats really a bad technique , you could use RequestDispatcher or sendRedirect .

Hope this helps !!

Community
  • 1
  • 1
Santhosh
  • 8,181
  • 4
  • 29
  • 56