Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP][JavaScript] Kalendarzyk w formularzu
em-ba
post
Post #1





Grupa: Zarejestrowani
Postów: 202
Pomógł: 3
Dołączył: 6.01.2008
Skąd: Mazowieckie

Ostrzeżenie: (0%)
-----


Witam, (IMG:http://forum.php.pl/style_emoticons/default/biggrin.gif) chciałbym zamieścic w formularzu pole data/godzina, gdzie po naciśnięciu na input wyświetli mi kalendarzyk z godziną..
Znalazłem pewną stronę z takim date pickerem.. http://www.softcomplex.com/products/tigra_...ndar/demo1.html ..ale mam problem z jego zamieszczeniem.. (IMG:http://forum.php.pl/style_emoticons/default/worriedsmiley.gif) tzn. wklejam kod i... przy formularzu widnieje mała ikonka kalendarza, ale po jej wciśnięciu nic się nie wyświetla (a powinien kalendarz).
Będę wdzięczny za każdą pomoc.. (IMG:http://forum.php.pl/style_emoticons/default/biggrin.gif)
Oto kod, który wkleiłem na stronę..
  1. <script language="JavaScript" src="calendar1.js"></script>
  2. </head>

  1. <form name="tstest">
  2. <table class="compat">
  3. <td>
  4. Select Date (w. year scrl.):<br>
  5. <input type="Text" name="input1" value="">
  6. <a href="javascript:cal1.popup();"><img src="img/cal.gif" width="16" height="16" border="0" alt="Click Here to Pick up the date"></a><br>
  7. Select Date (w/o year scrl.):<br>
  8. <input type="Text" name="input2" value="">
  9. <a href="javascript:cal2.popup();"><img src="img/cal.gif" width="16" height="16" border="0" alt="Click Here to Pick up the date"></a><br>
  10.  
  11. Select Timestamp (w. year scrl.):<br>
  12. <input type="Text" name="input3" value="">
  13. <a href="javascript:cal3.popup();"><img src="img/cal.gif" width="16" height="16" border="0" alt="Click Here to Pick up the date"></a><br>
  14. Select Timestamp (w/o year scrl.):<br>
  15. <input type="Text" name="input4" value="">
  16. <a href="javascript:cal4.popup();"><img src="img/cal.gif" width="16" height="16" border="0" alt="Click Here to Pick up the date"></a><br>
  17. </td>
  18. </tr>
  19.  
  20.  
  21. </form>
  22. <script language="JavaScript">
  23. var cal1 = new calendar1(document.forms['tstest'].elements['input1']);
  24. cal1.year_scroll = true;
  25. cal1.time_comp = false;
  26. var cal2 = new calendar1(document.forms['tstest'].elements['input2']);
  27. cal2.year_scroll = false;
  28. cal2.time_comp = false;
  29. var cal3 = new calendar1(document.forms['tstest'].elements['input3']);
  30. cal3.year_scroll = true;
  31. cal3.time_comp = true;
  32. var cal4 = new calendar1(document.forms['tstest'].elements['input4']);
  33. cal4.year_scroll = false;
  34. cal4.time_comp = true;
  35.  
  36. var cal5 = new calendar2(document.forms['tstest'].elements['input5']);
  37. cal5.year_scroll = true;
  38. cal5.time_comp = false;
  39. var cal6 = new calendar2(document.forms['tstest'].elements['input6']);
  40. cal6.year_scroll = false;
  41. cal6.time_comp = false;
  42. var cal7 = new calendar2(document.forms['tstest'].elements['input7']);
  43. cal7.year_scroll = true;
  44. cal7.time_comp = true;
  45. var cal8 = new calendar2(document.forms['tstest'].elements['input8']);
  46. cal8.year_scroll = false;
  47. cal8.time_comp = true;
  48.  
  49. var cal9 = new calendar3(document.forms['tstest'].elements['input9']);
  50. cal9.year_scroll = true;
  51. cal9.time_comp = false;
  52. var cal10 = new calendar3(document.forms['tstest'].elements['input10']);
  53. cal10.year_scroll = false;
  54. cal10.time_comp = false;
  55. var cal11 = new calendar3(document.forms['tstest'].elements['input11']);
  56. cal11.year_scroll = true;
  57. cal11.time_comp = true;
  58. var cal12 = new calendar3(document.forms['tstest'].elements['input12']);
  59. cal12.year_scroll = false;
  60. cal12.time_comp = true;
  61. <script type="text/javascript">
  62. var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
  63. document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
  64. <script type="text/javascript">
  65. var pageTracker = _gat._getTracker("UA-2103267-1");
  66. pageTracker._initData();
  67. pageTracker._trackPageview();
  68. </body>







...już dałem rade (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)

Ten post edytował em-ba 15.05.2008, 15:52:25
Go to the top of the page
+Quote Post
Marr
post
Post #2





Grupa: Zarejestrowani
Postów: 103
Pomógł: 1
Dołączył: 19.08.2008
Skąd: Warszawa

Ostrzeżenie: (0%)
-----


to jeżeli możesz to napisz co jest nie tak, bo również mam problem z tym pickerem, a moją znajomość javascript'u trudno nazwać nawet raczkującą (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)

ojejku faktycznie wielka filozofia... dla tych, którzy mogą mieć problem z czymś takim powiem, że kod funkcji odwołuje się do konkretnej nazwy formularza a w nim do konkretnego pola, które trzeba wprowadzić pod koniec kodu, np.
Cytat
<script language=\"JavaScript\">
var cal1 = new calendar1(document.forms['tstest'].elements['input1']);
?>


Ten post edytował Marr 19.08.2008, 14:18:16
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 25.08.2025 - 04:54