Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [JavaScript] aktywacja przycisku, po wprowadzeniu danych do 2 pól
gregi
post
Post #1





Grupa: Zarejestrowani
Postów: 100
Pomógł: 0
Dołączył: 11.09.2003

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


poniższy kod aktywuje przycisk id= submit jeżeli w pierwszej kolejności wpiszemy coś do pola o id pesel a potem do id=datwydarzenia
jeżeli robię to odwrotnie czyli pierw wydarzenia a potem pesel to przycisk się nie aktywuje
Help
  1. <script type="text/javascript">
  2. /*<![CDATA[*/
  3.  
  4. var setupCalendars = function() {
  5. if ((document.getElementById("datwydarzenia") != null && document.getElementById("pesel") != null)) {
  6. setupCalendar("datwydarzenia");
  7.  
  8. }
  9. };
  10.  
  11. var setupCalendar = function(dateField) {
  12. Calendar.setup({
  13. trigger : dateField,
  14.  
  15. inputField : dateField,
  16. dateFormat : "%Y-%m-%d",
  17. onSelect : function(buttonId) {
  18. this.hide();
  19. var dateFrom = document
  20. .getElementById("datwydarzenia");
  21. var peselForm = document.getElementById("pesel");
  22.  
  23. document.getElementById("submit").disabled = !(peselForm.value);
  24. }
  25. });
  26. };
  27.  
  28. /*]]>*/
  29. </script>
Go to the top of the page
+Quote Post

Posty w temacie


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: 24.08.2025 - 10:07