home *** CD-ROM | disk | FTP | other *** search
/ PC User 2005 May / CD / PCU0505CD.iso / software / full / coffecup / files / html2005.exe / %MAINDIR% / Javascript / password.xml < prev    next >
Encoding:
Text File  |  2005-02-16  |  1.4 KB  |  59 lines

  1. <ccResource>
  2.   <ccTitle>
  3. Site Password
  4.   </ccTitle>
  5.   <ccCategory>
  6. Browser
  7.   </ccCategory>
  8.   <ccDescription>
  9. A simple login and password script
  10.   </ccDescription>
  11.   <ccInstructions>
  12. The code goes only inside the BODY tags.  You can change the items below to suit your needs.
  13.   </ccInstructions>
  14.   <ccHeadContent>
  15.   
  16.   </ccHeadContent>
  17.   <ccBodyContent>
  18.  
  19. <script language="javascript">
  20. <!--//
  21. /*This Script allows people to enter by using a form that asks for a
  22. UserID and Password*/
  23. function pasuser(form) {
  24. if (form.id.value=="JavaScript") { 
  25. if (form.pass.value=="Kit") {              
  26. location="page2.html" 
  27. } else {
  28. alert("Invalid Password")
  29. }
  30. } else {  alert("Invalid UserID")
  31. }
  32. }
  33. //-->
  34. </script>
  35.  
  36. <center>
  37. <table bgcolor="white" cellpadding="12" border="1">
  38. <tr><td colspan="2"><center><h1><i><b>Login
  39. Area</b></i></h1></center></td></tr>
  40. <tr><td><h1><i><b>UserID:</b></i></h1></td><td><form name="login"><input
  41. name="id" type="text"></td></tr>
  42. <tr><td><h1><i><b>Password:</b></i></h1></td><td><input name="pass"
  43. type="password"></td></tr>
  44. <tr><td><center><input type="button" value="Login"
  45. onClick="pasuser(this.form)"></center></td><td><center><br><input
  46. type="Reset"></form></td></tr></table></center> 
  47.  
  48.   </ccBodyContent>
  49.   <ccElementContent>
  50.   
  51.    <ccElementName></ccElementName>
  52.    <ccElementAction></ccElementAction>
  53.    
  54.   </ccElementContent>
  55.   <ccExtraData>
  56.  
  57.   </ccExtraData>
  58. </ccResource>
  59.