Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [JavaScript][PHP] wyświetlenie wartości
Randallmaster
post
Post #1





Grupa: Zarejestrowani
Postów: 677
Pomógł: 11
Dołączył: 18.11.2009

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


W innych plikach mi wyświetla alert a tutaj nie chce pokazać nazwy wpisanej w col_name.

  1. <form action="?" method="post" enctype="multipart/form-data" onsubmit="return formCheck();" >
  2.  
  3. <div class="form_label">Nazwa Koloru:</div>
  4. <input class="text" type="text" name="col_name" value="" onkeyup="checkColName(this.value);"/>
  5.  
  6. </form>
  7. <script type="text/javascript">
  8. function formCheck() {
  9. alert(document.form.col_name.value);
  10. }
  11. </script>


Ten post edytował Randallmaster 26.06.2013, 14:53:54
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 5)
b4rt3kk
post
Post #2





Grupa: Zarejestrowani
Postów: 1 933
Pomógł: 460
Dołączył: 2.04.2010
Skąd: Lublin

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


Bo nie domknąłeś FORM:

  1. <form action="?" method="post" enctype="multipart/form-data" onsubmit="return formCheck();">


Ten post edytował b4rt3kk 26.06.2013, 14:48:09
Go to the top of the page
+Quote Post
Randallmaster
post
Post #3





Grupa: Zarejestrowani
Postów: 677
Pomógł: 11
Dołączył: 18.11.2009

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


Sorry źle skopiowałem jest domknięte w kodzie docelowym (IMG:style_emoticons/default/sad.gif)
Go to the top of the page
+Quote Post
b4rt3kk
post
Post #4





Grupa: Zarejestrowani
Postów: 1 933
Pomógł: 460
Dołączył: 2.04.2010
Skąd: Lublin

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


A może spróbuj tak?

  1. onsubmit="formCheck(); return false;"


Ten post edytował b4rt3kk 26.06.2013, 14:58:35
Go to the top of the page
+Quote Post
Randallmaster
post
Post #5





Grupa: Zarejestrowani
Postów: 677
Pomógł: 11
Dołączył: 18.11.2009

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


Cytat(b4rt3kk @ 26.06.2013, 15:57:04 ) *
Przekazujesz argument do funkcji:
  1. checkColName(this.value);

to jest argument do czegoś innego.

Docelowa funkcja jest w form onsubmit="return formCheck();"
Go to the top of the page
+Quote Post
b4rt3kk
post
Post #6





Grupa: Zarejestrowani
Postów: 1 933
Pomógł: 460
Dołączył: 2.04.2010
Skąd: Lublin

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


Cytat(Randallmaster @ 26.06.2013, 15:58:47 ) *
to jest argument do czegoś innego.

Docelowa funkcja jest w form onsubmit="return formCheck();"


Wiem, zasypiam już w robocie, dopiero zauważyłem po wysłaniu posta, że to nie o tę funkcję idzie. (IMG:style_emoticons/default/smile.gif) Patrz post wyżej.
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: 22.08.2025 - 23:08