Guest User

Untitled

a guest
May 16th, 2015
270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. if (sessionStorage.day == undefined) {
  2. sessionStorage.day = '01';
  3. }
  4. if (sessionStorage.month == undefined) {
  5. sessionStorage.month = '01';
  6. }
  7. if (sessionStorage.year == undefined) {
  8. sessionStorage.year = '1980';
  9. }
  10.  
  11. function incDay() {
  12. sessionStorage.day++;
  13. if (sessionStorage.day > 31) {
  14. sessionStorage.day = 1;
  15. incMonth();
  16. }
  17.  
  18. if (sessionStorage.day < 10) {
  19. sessionStorage.day = '0'+sessionStorage.day;
  20. }
  21. }
  22.  
  23. function incMonth() {
  24. sessionStorage.month++;
  25. if (sessionStorage.month > 12) {
  26. sessionStorage.month = 1;
  27. incYear();
  28. }
  29.  
  30. if (sessionStorage.month < 10) {
  31. sessionStorage.month = '0'+sessionStorage.month;
  32. }
  33. }
  34.  
  35. function incYear() {
  36. sessionStorage.year++;
  37. }
  38.  
  39. function submitForm(day, month, year) {
  40. //Тут поменяй anon на нужное имя
  41. $("#email").val('Anon');
  42. $("#dateDay").val(day);
  43. $("#dateMonth").val(month);
  44. $("#dateYear").val(year);
  45. document.getElementById("forgotten-password-form").submit();
  46. }
  47.  
  48. submitForm(sessionStorage.day, sessionStorage.month, sessionStorage.year);
  49. incDay();
Advertisement
Add Comment
Please, Sign In to add comment