1. <html>
2. <%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
3. <%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
4. <f:view>
5. <head>
6. <title>
7. <h:outputText value="#{msgs.windowTitle}"/>
8. </title>
9. </head>
10. <body>
11. <h:form id="registerForm">
12. <table>
13. <tr>
14. <td>
15. <h:outputText value="#{msgs.namePrompt}"/>
16. </td>
17. <td>
18. <h:inputText/>
19. </td>
20. </tr>
21. <tr>
22. <td>
23. <h:outputText value="#{msgs.passwordPrompt}"/>
24. </td>
25. <td>
26. <h:inputSecret id="password"/>
27. </td>
28. </tr>
29. <tr>
30. <td>
31. <h:outputText value="#{msgs.confirmPasswordPrompt}"/>
32. </td>
33. <td>
34. <h:inputSecret id="passwordConfirm"/>
35. </td>
36. </tr>
37. </table>
38. <h:commandButton type="button" value="Submit Form"
39. onclick="checkPassword(this.form)"/>
40. </h:form>
41. </body>
42. <script type="text/javascript">
43. <!--
44. function checkPassword(form) {
45. var password = form["registerForm:password"].value;
46. var passwordConfirm = form["registerForm:passwordConfirm"].value;
47.
48. if(password == passwordConfirm)
49. form.submit();
50. else
51. alert("Password and password confirm fields don't match");
52. }
53. -->
54. </script>
55. </f:view>
56. </html>
评论
发表评论

您还没有登录,请登录后发表评论

isky
搜索本博客
我的相册
A1241590-4201-3a57-ab8c-bfa7c633b181-thumb
SL372068
共 7 张
存档
最新评论