Wie Sie einen Wert aus einem Textfeld in php, ohne die Verwendung einer form-element in HTML

Ich brauche, um einen Wert aus einem Textfeld, aber ich bin nicht mit einem Formular, daher kann ich nicht verwenden, $_POST oder $_GET. Gibt es irgendeine Methode, um den Wert aus dem Textfeld? Unten ist der code, den ich verwende

<input name="txtQty" type="text" id="txtQty" size="5" value="<?php echo $qty; ?>" onKeyUp="checkNumber(this);"> //here I'm the displaying the quantity, then the user can change it, and I need to get that value to pass it throught this link: 

<input name="btnEdit" type="button" value="Edit" onClick="window.location.href='<?php echo $_SERVER['PHP_SELF'] . "?action=update&cid=$shoppingCartId&qty=$qty //here I need that new value from the textbox"; ?>';"

Vielen Dank für Ihre Hilfe

  • warum sind Sie nicht mit einem Formular?
  • AJAX ist Ihre einzige option, ohne ein Formular ... aber warum kein Formular ?
  • Sie müssen einige JS, aber ein einfaches Formular mit hidden-inputs für die action und cid, und nennen Sie die Menge input qty wäre es viel sauberer.
InformationsquelleAutor xupla | 2012-01-05
Schreibe einen Kommentar