• Das Erstellen neuer Accounts wurde ausgesetzt. Bei berechtigtem Interesse bitte Kontaktaufnahme über die üblichen Wege. Beste Grüße der Admin

xhtml validieren

Bieber

New member
ich bin mal wieder zu blöd meinen Code valide zu bekommen, Doctype ist
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
hier die entsprechende Codestelle:
PHP:
<h1>Neuen Nutzer anlegen</h1>
    
	    <form action="?section=new_user.pl" method="post" name="form">
	        <table>
	        <tr>
	          <td>Username:</td>
	          <td><input type="text" name="user" maxlength="30" /></td>
	        </tr>
	        <tr>
	          <td></td>
	        </tr>
	        <tr>
	            <td>Passwort:</td>
	            <td><input type="password" name="passwort" maxlength="30" /></td>
	            <td> Bitte nur Passwort eingeben, <br />wenn <b>kein</b> LDAP genutzt wird.</td>
	        </tr>
	        <tr>
	            <td>Administrator:</td>
	            <td><input type="checkbox" name="admin" value="0" /></td>
	        </tr>
	        <tr>
	            <td>Monitoring:</td>
	            <td><input type="checkbox" name="monitoring" value="0" /></td>
	        </tr>
	        <tr>
	          <td>Gruppen:</td>
	          <td><select name="a" multiple>
		          
				  <!-- TMPL_LOOP NAME=LOOP -->
					<option value="<!-- TMPL_VAR NAME=NUMMER -->"><!-- TMPL_VAR NAME=BERECHTIGUNG --></option>
				  <!-- /TMPL_LOOP -->
				  </select>	
		      </td>
		      <td>
		      		<a href="javascript:shiftBox(document.form.a,document.form.b);">>>></a>
  					<a href="javascript:shiftBox(document.form.b,document.form.a);"><<<</a>
		      </td>
		      <td>
		      	<select name="b" multiple></select>
		      		
		      </td>
	        </tr>
	        <tr>
	            <td>
	              <input type="submit" name="submit" value="anlegen" />
	            </td>
	        </tr>
	        <tr>
	          <td></td>
	        </tr>
	        </table>
	     </form>

Es geht um die Shiftbox. Folgende Fehler spuckt der w3c aus:

Code:
# Line 100, Column 41: the name and VI delimiter can be omitted from an attribute specification only if SHORTTAG YES is specified

	          <td><select name="a" multiple>

✉

"VI delimiter" is a technical term for the equal sign. This error message means that the name of an attribute and the equal sign cannot be omitted when specifying an attribute. A common cause for this error message is the use of "Attribute Minimization" in document types where it is not allowed, in XHTML for instance.

How to fix: For attributes such as compact, checked or selected, do not write e.g <option selected ... but rather <option selected="selected" ...
# Error Line 111, Column 35: the name and VI delimiter can be omitted from an attribute specification only if SHORTTAG YES is specified

		      	<select name="b" multiple></select>

✉

"VI delimiter" is a technical term for the equal sign. This error message means that the name of an attribute and the equal sign cannot be omitted when specifying an attribute. A common cause for this error message is the use of "Attribute Minimization" in document types where it is not allowed, in XHTML for instance.

How to fix: For attributes such as compact, checked or selected, do not write e.g <option selected ... but rather <option selected="selected" ...
# Error Line 111, Column 44: end tag for "select" which is not finished

		      	<select name="b" multiple></select>

✉

Most likely, you nested tags and closed them in the wrong order. For example <p><em>...</p> is not acceptable, as <em> must be closed before <p>. Acceptable nesting is: <p><em>...</em></p>

Another possibility is that you used an element which requires a child element that you did not include. Hence the parent element is "not finished", not complete. For instance, in HTML the <head> element must contain a <title> child element, lists (ul, ol, dl) require list items (li, or dt, dd), and so on.
# Error Line 100, Column 40: XML Parsing Error: Specification mandate value for attribute multiple

	          <td><select name="a" multiple>

✉
# Error Line 111, Column 34: XML Parsing Error: Specification mandate value for attribute multiple

		      	<select name="b" multiple></select>

kann damit aber leider nichts anfangen, könnte mir bitte wer auf die Sprünge helfen?
 
Zuletzt bearbeitet:
Muss es nicht multiple="multiple" heißen? *mal ins blaue hineinschießt*
 
Muss es nicht multiple="multiple" heißen? *mal ins blaue hineinschießt*

richtig :icon7:, danke

jetzt ist nur noch das Problem, dass die zweite Select-Box ja am Anfang leer ist:
PHP:
<select name="groups" size="5" multiple="multiple"></select>

und das gefällt ihm auch nicht:
Code:
end tag for "select" which is not finished

…="groups" size="5" multiple="multiple"></select>

✉

Most likely, you nested tags and closed them in the wrong order. For example <p><em>...</p> is not acceptable, as <em> must be closed before <p>. Acceptable nesting is: <p><em>...</em></p>

Another possibility is that you used an element which requires a child element that you did not include. Hence the parent element is "not finished", not complete. For instance, in HTML the <head> element must contain a <title> child element, lists (ul, ol, dl) require list items (li, or dt, dd), and so on.
 
Hallo Bieber,

die zweite Fehlermeldung hängt sehr wahrscheinlich mit der ersten zusammen und verschwindet auch mit ihr wieder.

Das Problem ist in der Tat, dass das <select>-Tag keine Elemente enthält. Laut XHTML-Spezifikation darf das nicht sein, daher die Fehlermeldung. Wenn möglich solltest du daher die Ausgabe des <select>s ganz unterbinden, andernfalls kannst du dir Abhilfe schaffen, indem du ein Element hinzufügst:
Code:
<select name="groups" size="5" multiple="multiple"><option> </option></select>

Grüsse
jeko
 
die Ausgabe des leeren selects kann ich nicht unterbinden, sonst würden die Nutzer nicht kapieren was Sie machen müssen, das Einfügen einer leeren Option löst das Problem, aber eigentlich hat die da nichts verloren...

ich glaube dann akzeptiere ich den einen Fehler, usability ist mir wichtiger als valider Code
 
sorry ich kann grad kein Beispiel hochladen deswegen mal so^^:

select 1
select 2​
-superadmin
-admin
<<< >>>>​
-hanswurst
-supernoob

Im Selectfeld 1 werden dynamisch alle Gruppenberechtigungen aus der DB ausgelesen die Verfügbar sind. Hier kann nun angeklickt werden und über die Pfeile wird die Auswahl in Select 2 übernommen. Alles was nun in Select 2 ist wird beim Anlegen des Nutzers berücksichtigt. Wird nichts ausgewählt hat der Nutzer keine Gruppe (auch diesen Fall gibt es in meiner Anwendung). Es gibt also keinen Grund das Select vorher zu belegen.
 
Hallo Bieber,

du könntest das Problem ja mit einem Eintrag "Keine" lösen:
Code:
<select name="groups">
<option value="-1">Keine</option>
</select>
Deine verarbeitendes Script braucht dann nur nach positiven Werten Ausschau halten bzw. negative ausfiltern (solltest du keine Zahlenwerte übergeben).

Grüsse
jeko
 
Zurück
Oben