Punkte zwischen den Zahlen automatisch erzeugen.

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • #16
    @topicstarter:
    Den Code auch im IE getestet ? Funzt bei mir IE 6 und WinXp nicht (gibt nur ne Fehlermeldung)
    PHP-Code:
    <html>
    <
    head>
    <
    script type="text/javascript">
    <!--
    var 
    punkt 0;
    function 
    setPoint(){
        var 
    temp document.getElementById('datum').value;
        if((
    temp.length+1) % == && punkt 2){
            
    punkt += 1;
            
    document.getElementById('datum').value temp '.';
        }
    }
    -->
    </
    script>
    </
    head>
    <
    body>
    <
    form>
    <
    input type="text" id="datum" onkeyup="setPoint();return false;"/>
    </
    form>
    </
    body>
    </
    html
    sollte auch im IE funzen.

    Gruss

    tobi
    Gutes Tutorial | PHP Manual | MySql Manual | PHP FAQ | Apache | Suchfunktion für eigene Seiten

    [color=red]"An error does not become truth by reason of multiplied propagation, nor does truth become error because nobody sees it."[/color]
    Mohandas Karamchand Gandhi (Mahatma Gandhi) (Source)

    Kommentar


    • #17
      der kann auch nicht im ff funzen:
      PHP-Code:
      zeichen document.Form.eingabe.value.length
      das textfeld heißt nicht eingabe sondern datum
      PHP-Code:
      zeichen document.Form.datum.value.length
      der rest ist natürlich dann auch falsch.

      gruß
      peter
      Nukular, das Wort ist N-u-k-u-l-a-r (Homer Simpson)
      Meine Seite

      Kommentar


      • #18
        ich hatte mal im Codeschnipsel vor 2 Jahren (glaube ich) was gepostet, was genau das macht

        Kommentar


        • #19
          Sorry, kleiner Tippfehler.
          Habe es korrigiert.

          PHP-Code:
          <script type="text/javascript"
          function 
          punkte(){ 
           
          zeichen document.Form.datum.value.length
           
          text document.Form.datum.value
           if (
          zeichen == 2) { 
            
          document.Form.datum.value text+"."
           } 
           if (
          zeichen == 5) { 
            
          document.Form.datum.value text+".2006"
           } 

          </
          script

          <
          form name="Form"
           
          Datum: <input type=text name="datum" size=10 onKeyUp="punkte();"
          </
          form
          Läuft bei mir in Firefox und unter IE7.
          Bei IE7 muss Java zugelassen bzw. aktiviert werden.
          Alles ohne Probleme!

          Kommentar


          • #20
            Bei IE7 muss Java zugelassen bzw. aktiviert werden.
            Hoffentlich meinst du Javascript

            Gruss

            tobi
            Gutes Tutorial | PHP Manual | MySql Manual | PHP FAQ | Apache | Suchfunktion für eigene Seiten

            [color=red]"An error does not become truth by reason of multiplied propagation, nor does truth become error because nobody sees it."[/color]
            Mohandas Karamchand Gandhi (Mahatma Gandhi) (Source)

            Kommentar

            Lädt...
            X