1

別のテキスト ボックスで jquery + ajax から結果を生成するにはどうすればよいですか

<form action="someanotherpage.php">
   <input type="text" name="data" value="" id="data"/>
   <input type="text" name="response_data_here" value="" id="response"/>
    <input type="submit" value="Apply" />
</form>

編集: いくつかのコンテンツを編集しました.#data テキストボックスを使用してデータベースでクエリを実行し、その結果を #response テキストボックスに表示することを忘れて申し訳ありません。現時点で混乱していたことを許してください

何か提案はありますか?それは可能ですか?どんな助けも大歓迎です。ありがとう

4

1 に答える 1

0

これはトリックを行う必要があります:

あなたのフォーム:

<form action="someanotherpage.php">
   <input type="text" name="data" value="" id="data "/>
   <input type="text" name="response_data_here" value="" id="data2" />
</form>

JQuery:

$(function(){
  $("#data").keypress(function(){
    $("#data2").val($(this).val());
  });
});
于 2010-03-02T12:39:46.337 に答える