如何使用Jquery& Ajax将文本框值传递给其他页面 [英] How to pass textbox value to other page using Jquery&Ajax
本文介绍了如何使用Jquery& Ajax将文本框值传递给其他页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要将文本框输入的值传递给另一个页面而不用Php中的提交按钮。
我的编码:
I need to pass textbox entered value to another page without submit button in Php.
My coding:
<form name="frm1" id="frm1" method="post" enctype="multipart/form-data">
<label>SEARCH:</label>
<input name="tag" type="text" id="tag" size="20" />
<input name="tag1" type="text" id="tag1" size="20" />
</form>
<script>
$(document).ready(function() {
$("#tag").change(function() {
$.ajax({
type: "POST",
url: "autocomplete1.php",
data: {
tag: $("#tag").val()
},
success: function(result) {
alert(tag);
}
});
});
});
</script>
推荐答案
(document).ready(function(){
(document).ready(function() {
(# tag)。change(function(){
("#tag").change(function() {
.ajax({
type:POST,
url:autocomplete1.php,
数据:{
tag:
.ajax({ type: "POST", url: "autocomplete1.php", data: { tag:
这篇关于如何使用Jquery& Ajax将文本框值传递给其他页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文