Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

71 lines
1.7 KiB

  1. <script language="JavaScript">
  2. //
  3. // Copyright (c) Microsoft Corporation. All rights reserved.
  4. //
  5. // validates user entry
  6. function GenValidatePage()
  7. {
  8. var objSharename=document.frmTask.txtShareName;
  9. var strShareName=objSharename.value;
  10. var objSharepath=document.frmTask.txtSharePath;
  11. var strSharePath=objSharepath.value;
  12. UpdateHiddenVaribles()
  13. return true;
  14. }
  15. //function which executes when form loads..
  16. function GenInit()
  17. {
  18. // for clearing error message when serverside error occurs
  19. document.frmTask.onkeypress = ClearErr
  20. }
  21. // function to make the Ok button disable
  22. function makeDisable(objSharename)
  23. {
  24. var strSharename=objSharename.value;
  25. if (Trim(strSharename)== "")
  26. DisableOK();
  27. else
  28. EnableOK();
  29. }
  30. //Dummy function for Framework
  31. function GenSetData()
  32. {
  33. }
  34. //to update the hidden variables
  35. function UpdateHiddenVaribles()
  36. {
  37. document.frmTask.hidSharename.value = document.frmTask.txtShareName.value;
  38. document.frmTask.hidSharePath.value = document.frmTask.txtSharePath.value;
  39. var strClients
  40. var objCheckBox
  41. strClients = ""
  42. for(var i=0; i < document.frmTask.clients.length; i++)
  43. {
  44. objCheckBox = eval(document.frmTask.clients[i])
  45. if (objCheckBox.checked)
  46. strClients = strClients + objCheckBox.value
  47. }
  48. document.frmTask.hidSharesChecked.value = strClients
  49. }
  50. // to count the number of occurences of given character in the text
  51. function countChars(strText,charToCount)
  52. {
  53. var searchFromPos = 0;
  54. var charFoundAt =0;
  55. var count = 0;
  56. while((charFoundAt=strText.indexOf(charToCount,searchFromPos)) >= 0)
  57. {
  58. count++;
  59. searchFromPos = charFoundAt + 1;
  60. }
  61. return count ;
  62. }
  63. </script>