Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [XHTML/W3C] Walidowanie pola input
free
post 28.05.2007, 09:54:45
Post #1





Grupa: Zarejestrowani
Postów: 269
Pomógł: 0
Dołączył: 6.02.2006

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


W poniższym kodzie parser XHTML podaje błąd:
  1. <input name="login" class="log" value="login" onblur="if(this.value=='')this.value='login'"
  2. onfocus="if(this.value=='login')this.value=''" type="text" />
]

Jak to zmodyfikowac by byl poprawny z W3C:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 4)
mike
post 28.05.2007, 10:02:35
Post #2





Grupa: Przyjaciele php.pl
Postów: 7 494
Pomógł: 302
Dołączył: 31.03.2004

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


A nie sądzisz, że można by podać treść tego błędu?
Skąd mamy wiedzieć co jest nie tak? Jasnowidzów na forum brak.

Polecam: Jak mądrze zadawać pytania
Go to the top of the page
+Quote Post
free
post 28.05.2007, 10:23:32
Post #3





Grupa: Zarejestrowani
Postów: 269
Pomógł: 0
Dołączył: 6.02.2006

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


document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag.

onfocus="if(this.value=='login')this.value=''" type="text" />

The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.

One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
Go to the top of the page
+Quote Post
mike
post 28.05.2007, 10:28:11
Post #4





Grupa: Przyjaciele php.pl
Postów: 7 494
Pomógł: 302
Dołączył: 31.03.2004

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


Od razu prościej, nie?
Masz tag <input /> umieszczony w złym miejscu. Pewnie dałeś go od razu w <form /> albo gdzieś gdzie nie jest dozwolony.
Aby był poprawnie umieszczony musi się znaleźć w jednym z mymienionych tagów.

Zresztą czy tak trudno wejść na translatica.pwn.pl i samemu przetłumaczyć frazę: "document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag."

Przeciez całe wytłumaczenie masz w treści tego komunikatu.
Go to the top of the page
+Quote Post
free
post 28.05.2007, 10:33:11
Post #5





Grupa: Zarejestrowani
Postów: 269
Pomógł: 0
Dołączył: 6.02.2006

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


wiem tez sie domyslilem juz sprawdzilem. Dopiero zaczynam z XHTML, dotychczas korzystałem z HTML 4.01.
Go to the top of the page
+Quote Post

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

 



RSS Wersja Lo-Fi Aktualny czas: 14.08.2025 - 01:28