Anzeige:
Ergebnis 1 bis 6 von 6

Thema: [XHTML 1.0 Transitional] Was soll das? - onClick

  1. #1
    Registrierter Benutzer
    Registriert seit
    08.07.2002
    Beiträge
    377

    Arrow [XHTML 1.0 Transitional] Was soll das? - onClick

    Was ist mit dem onClick-Attribut?
    Hab folgenden Code:
    HTML-Code:
    <table border="1">
    <tr>
    
    <td colspan="3">
    <div class="titleRow">titleText</div>
    </td>
    </tr>
    <tr>
    <td class="row1">
    Test Page&nbsp;</td>
    <td class="row1" width="2%">
    <div align="center"><form action="connect.php" method="post">
    <img alt="" onClick="" src="include/theme/default/images/inactive.png" />
    <input name="cnn_type" type="hidden" value="0" />
    <input name="cnn_usr" type="hidden" value="1" />
    <input name="cnn_pg" type="hidden" value="3" />
    </form></div></td>
    <td class="row1" width="2%">
    
    <div align="center"><form action="connect.php" method="post">
    <img alt="" onClick="" src="include/theme/default/images/inactive.png" />
    <input name="cnn_type" type="hidden" value="0" />
    <input name="cnn_usr" type="hidden" value="1" />
    <input name="cnn_pg" type="hidden" value="3" />
    </form></div></td>
    </tr>
    <tr>
    <td class="row1">
    test2&nbsp;</td>
    <td class="row1" width="2%">
    <div align="center"><form action="connect.php" method="post">
    <img alt="" onClick="" src="include/theme/default/images/inactive.png" />
    <input name="cnn_type" type="hidden" value="0" />
    <input name="cnn_usr" type="hidden" value="1" />
    <input name="cnn_pg" type="hidden" value="2" />
    
    </form></div></td>
    <td class="row1" width="2%">
    <div align="center"><form action="connect.php" method="post">
    <img alt="" onClick="" src="include/theme/default/images/inactive.png" />
    <input name="cnn_type" type="hidden" value="0" />
    <input name="cnn_usr" type="hidden" value="1" />
    <input name="cnn_pg" type="hidden" value="2" />
    </form></div></td>
    </tr>
    </table>
    Das onClick-Attribute bei den Bilder brauche ich um das Formular zu uebermitteln.
    Gibt es onClick in XHTML nicht - und wenn ja, wie soll das sonst gehn?

    mfg
    Amilo D - 2,8 Ghz - ATI Radeon 9000
    Debian GNU/Linux 3.1 (Sarge)

  2. #2
    Registrierter Benutzer
    Registriert seit
    15.10.2005
    Ort
    Franken
    Beiträge
    362
    <input type="image">
    Allerdings funzt onclick trotzdem, ich würde nur auch ein event auslösen, wenn drauf geklickt wird
    Dank der Rekursion kann ich IF-Schleifen bauen.

    In neuem Glanz: www.turbohummel.de

  3. #3
    Registrierter Benutzer Avatar von undefined
    Registriert seit
    01.03.2004
    Beiträge
    1.255
    Leere Attributes sind in XHTML nicht erlaubt.
    mfg undefined
    --
    Undefined Behavior (undefiniertes Verhalten) bedeutet meistens etwas ungültiges.
    xhtml Debugger

  4. #4
    Registrierter Benutzer
    Registriert seit
    08.07.2002
    Beiträge
    377
    Das mit den leeren Attributen ist schon war, der Validator meckert aber immer noch!
    Der Text hat sich jetzt ein wenig geaendert:
    HTML-Code:
    <table border="1">
    <tr>
    
    <td colspan="3">
    <div class="titleRow">Connect User &amp; Project</div>
    </td>
    </tr>
    <tr>
    <td class="row1">
    <span class="tableItemTitle">Test Page</span></td>
    <td class="row1" width="2%">
    <div align="center"><form action="connect.php" id="form_index_0" method="post">
    <img alt="" onClick="document.getElementById( 'form_index_0').submit();" src="include/theme/default/images/active.png" />
    <input name="usr_id" type="hidden" value="10" />
    <input name="cnn_pg" type="hidden" value="3" />
    <input name="todo" type="hidden" value="disable" />
    
    <input name="field" type="hidden" value="cnn_index" />
    </form></div></td>
    <td class="row1" width="2%">
    <div align="center"><form action="connect.php" id="form_admin_1" method="post">
    <img alt="" onClick="document.getElementById( 'form_admin_1').submit();" src="include/theme/default/images/active.png" />
    <input name="usr_id" type="hidden" value="10" />
    <input name="cnn_pg" type="hidden" value="3" />
    <input name="todo" type="hidden" value="disable" />
    <input name="field" type="hidden" value="cnn_admin" />
    </form></div></td>
    </tr>
    <tr>
    <td class="row1">
    <span class="tableItemTitle">test2</span></td>
    <td class="row1" width="2%">
    <div align="center"><form action="connect.php" id="form_index_2" method="post">
    
    <img alt="" onClick="document.getElementById( 'form_index_2').submit();" src="include/theme/default/images/inactive.png" />
    <input name="usr_id" type="hidden" value="10" />
    <input name="cnn_pg" type="hidden" value="2" />
    <input name="todo" type="hidden" value="enable" />
    <input name="field" type="hidden" value="cnn_index" />
    </form></div></td>
    <td class="row1" width="2%">
    <div align="center"><form action="connect.php" id="form_admin_3" method="post">
    <img alt="" onClick="document.getElementById( 'form_admin_3').submit();" src="include/theme/default/images/inactive.png" />
    <input name="usr_id" type="hidden" value="10" />
    <input name="cnn_pg" type="hidden" value="2" />
    <input name="todo" type="hidden" value="enable" />
    <input name="field" type="hidden" value="cnn_admin" />
    </form></div></td>
    </tr>
    </table>
    Er sagt:
    Code:
    Line 119 column 20: there is no attribute "onClick".
    
    <img alt="" onClick="document.getElementById( 'form_index_0').submit();" src="in
    
    You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).
    
    This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.
    
    How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute.
    Das waere praktisch diese Zeile:
    Code:
    <img alt="" onClick="document.getElementById( 'form_index_0').submit();" src="include/theme/default/images/active.png" />
    Ich werd jetzt mal das mit dem input type versuchen, aber ich befuerchte dass ist dann kein submit bzw. ich kann das onclick auch nicht verwenden.

    Ach, und das alt="" prangert er nicht an!
    Amilo D - 2,8 Ghz - ATI Radeon 9000
    Debian GNU/Linux 3.1 (Sarge)

  5. #5
    Registrierter Benutzer
    Registriert seit
    22.08.2002
    Ort
    Nürnberg
    Beiträge
    638
    Ich würde statt onClick einfach mal onclick schreiben (siehe hier: http://www.w3.org/TR/xhtml1/#h-4.2).

    Pingu
    Homepage: www.pingu.info

  6. #6
    Registrierter Benutzer
    Registriert seit
    08.07.2002
    Beiträge
    377
    @Pingu: Genau das wars - verdammt, ich wusste dass XHTML alles in Kleinbuchstaben macht, warum bin ich da nicht selbst draufgekommen dass es das war.

    Hab mittlerweile auch die Java-Script-Inkompartibilitaeten zu XHTML entfernt, jetzt ist das ganze Projekt kompatibel *freu*.
    Amilo D - 2,8 Ghz - ATI Radeon 9000
    Debian GNU/Linux 3.1 (Sarge)

Lesezeichen

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •