Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Wyłączanie przycisku w formularzu, Utudnienie: Dziwna nazwa przycisku
franki
post
Post #1





Grupa: Zarejestrowani
Postów: 12
Pomógł: 0
Dołączył: 6.02.2005

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


  1. <form name="Formularz"><input type="submit" name="Wykonaj[1234]" value="Zapisz zmiany"></form>

Jak wyłączyć (disable) w javascript powyższe pole formularza?
bo ten kod niestety nie działa
  1. <script language="JavaScript"><!--
  2. document.Formularz.Wykonaj[1234].disabled=true;
  3. //--></script>
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
dr_bonzo
post
Post #2





Grupa: Przyjaciele php.pl
Postów: 5 724
Pomógł: 259
Dołączył: 13.04.2004
Skąd: N/A

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


Kod
<html>
   <head>
       <script type="text/javascript">
       
           function disableThem()
           {
               document.getElementById( 'submit_0' ).disabled = true;
               document.getElementById( 'submit_1' ).disabled = true;
           }
           
           function disableThem2()
           {
               formularz = document.getElementById( 'Formularz' );
               
               for ( i = 0; i < formularz.length; i++ )
               {
                   if ( formularz[ i ].type == 'submit' )
                   {
                       formularz[ i ].disabled = true;
                   }
               }
           }
           
       </script>
   </head>
   <body onLoad="disableThem2()">
       <form name="Formularz" id="Formularz">
           <input type="submit" name="Wykonaj[0]" value="Dodaj" id="submit_0">
           <input type="submit" name="Wykonaj[0]" value="Usun" id="submit_1">
       </form>
   </body>
</html>

(EDIT -- usunalem kilka bzdur (IMG:http://forum.php.pl/style_emoticons/default/smile.gif) )

Ten post edytował dr_bonzo 8.02.2005, 19:14:31
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: 2.10.2025 - 21:36