Button bei *Enter* nicht ausführen

Dieses Thema im Forum "Webentwicklung" wurde erstellt von Hardwarehunger, 28. Mai 2006 .

Status des Themas:
Es sind keine weiteren Antworten möglich.
  1. 28. Mai 2006
    hiho

    und zwar hab ich hier ein script von nem kumpel:

    Code:
    <style type="text/css">
    <!--
    .Stil1 {font-family: "Courier New", Courier, mono; font-weight: bold;}
    .Stil2 {font-family: "Courier New", Courier, mono; font-weight: bold; font-size: 18px;}
    -->
    </style>
    <form id="Form1" name="Form1" method="get" action="" >
    <div align="center">
    <p class="Stil2">Bitte Passwort eingeben:</p>
    <p class="Stil1"><input name="Textbox" type="text" style="width:150px"/>
    <input name="Button" type="button" value="Go!" onClick="href=top.location.href=document.Form1.Textbox.value"/>
    </p>
    </div>
    </form>
    es dient dazu das eingegebene wort an die url hinanzufügen. nur gibt es da ein prob:
    wenn ich mit enter bestätige hängt er mir ein "?Textbox=" dran, was ich eigentlich garnicht gebrauchen kann. nun hat vlt jemand von euch ne lösung zu dem prob?
     
  2. 28. Mai 2006
    <form action="" method="GET">
    <input type="text" name="TEXT" id="lol">
    <input type="button" value="GO" onClick="top.location.href = top.location.href +'?Text='+document.getElementById('lol').value;">
    </form>

    Oder was meinst du?^^
     
  3. 28. Mai 2006
    ?Text=

    ^^ wieder das gleiche
     
  4. 28. Mai 2006
    Ich hab das so verstanden:

    [ ......... ] textfeld.

    bei Klick auf Button wird der Wert dadrin an die URL angefügt ->

    ?Text=[hiertext].
    und so funzt das auch bei mir


    wie wolltest du das denn? ^^
     
  5. 28. Mai 2006
    ohne dieses ?Text=

    also anstatt:
    /?Text=Textboxinhalt

    nur
    /Textboxinhalt

    10ner haste aber schonmal für die hilfe
     
  6. 28. Mai 2006
    Achso...

    <form action="" method="GET">
    <input type="text" name="TEXT" id="lol">
    <input type="button" value="GO" onClick="top.location.href = top.location.href + '/'+document.getElementById('lol').value;">
    </form>

    How about this? :x

    Ansonsten guck dir mal den Part an:

    onClick="top.location.href = top.location.href + '/' + document.getElementById('lol').value;"

    top.location.href + '/' + document....

    da kannste bestimmen wie's aussehen soll. der Wert ausm Eingabefeld ist:

    document.getElementById('lol').value

    mfG
     
  7. 28. Mai 2006
    wen ich auf go mit der maus klicke gehts komischerweise

    mit enter aber net ?(
     
  8. 29. Mai 2006
    das liegt dann wohl am browser...
     
  9. Video Script

    Videos zum Themenbereich

    * gefundene Videos auf YouTube, anhand der Überschrift.