フォームがあり、テキスト ボックスの値を php 側に送信する必要があります。
私は常に変数の値を非表示にしてから、php 側に送信します。これはばかげていると思います。そのようなテキストボックスの値を送信する方法はありますか
$.post("adasda", {"degisken1":$("#txtEmail").val()} ,function(response){})
フォームがあり、テキスト ボックスの値を php 側に送信する必要があります。
私は常に変数の値を非表示にしてから、php 側に送信します。これはばかげていると思います。そのようなテキストボックスの値を送信する方法はありますか
$.post("adasda", {"degisken1":$("#txtEmail").val()} ,function(response){})
はい、jquery ajax 、 post または get メソッドを介してテキストボックスの値を送信できます。以下はサンプルの例です
$("#searchForm").submit(function(event) {
/* stop form from submitting normally */
event.preventDefault();
/* get some values from elements on the page: */
var $form = $( this ),
term = $form.find( 'input[name="s"]' ).val(),
url = $form.attr( 'action' );
/* Send the data using post and and get the results */
$.post( url, { s: term },
function( data ) {
// write your code here
}
);
});
詳細はこちらhttp://api.jquery.com/jQuery.post/
ありがとう