<!doctype html> <html> <% String bgColor = request.getParameter("bgColor"); String thefont = request.getParameter("thefont"); String testing=request.getParameter("testing"); if (testing==null&&bgColor==null) { bgColor = "WHITE"; thefont="serif"; testing="no"; } else { if (bgColor.trim().length()==0) { bgColor="WHITE"; } } %> <head> <title>Testing Styles</title> <style> body { background-color: <%= bgColor %>; font-style: <%= thefont %>; } </style> <script > function ResetPage(){ document.location.href = "http://hoare.cs.umsl.edu/servlet/j-siegel/colorfontjs.jsp"; } </script> </head> <body> <h1 ALIGN="CENTER">Testing Colors and Font Styles.</h1> <hr /> <% if(testing.equals("no")){ %> <form> Color: <input TYPE="TEXT" NAME="bgColor" /><br /> <br /> Font Style: <select TYPE="TEXT" NAME="thefont" > <option value="normal">normal</option> <option value="italic">italic</option> </select> <br /> <br /> <input TYPE="HIDDEN" NAME="testing" VALUE="yes" /><input TYPE="SUBMIT" VALUE="Try the Color"> </form> <% }else{ %> <h1>Do You like the Background Color <%= bgColor %> and Font <%= thefont %><br /> <button onclick="ResetPage()">Try Another</button> <% } %> </body> </html>