<html> <head> <title>ThaiCreate.Com JSP Tutorial</title> </head> <body> <form name="frmAdd" method="post" action="post.jsp"> Input Your Information <br> Name <input type="text" name="txtName"> Email <input type="text" name="txtEmail"> <br><br> <input type="checkbox" name="chkBox1" value="Y"> Item1 <input type="checkbox" name="chkBox1" value="Y"> Item2</p> <p> <input name="radioOption" type="radio" value="Option 1"> Option 1 <input name="radioOption" type="radio" value="Option 2"> Option 2<br> <br> <select name="selItem"> <option value="Item1">Item1</option> <option value="Item 2">Item 2</option> <option value="Item 3">Item 3</option> </select> </p> <input type="submit" value="Submit"> </form> </body> </html>
<html> <head> <title>ThaiCreate.Com JSP Tutorial</title> </head> <body> <% String strName = request.getParameter("txtName"); String strEmail = request.getParameter("txtEmail"); out.println("Name : " + strName); out.println("<br>"); out.println("Email : " + strEmail); out.println("<br>"); String strchkBox1 = request.getParameter("chkBox1"); String strchkBox2 = request.getParameter("chkBox2"); out.println("chkBox1 : " + strchkBox1); out.println("<br>"); out.println("chkBox2 : " + strchkBox2); out.println("<br>"); String strradioOption = request.getParameter("radioOption"); out.println("radioOption : " + strradioOption); out.println("<br>"); String strselItem = request.getParameter("selItem"); out.println("selItem : " + strselItem); out.println("<br>"); %> </body> </html>
ช่วยกันสนับสนุนรักษาเว็บไซต์ความรู้แห่งนี้ไว้ด้วยการสนับสนุน Source Code 2.0 ของทีมงานไทยครีเอท