答案 0 :(得分:0)
使用onchange
或onkeyup
来检测用户何时输入。
答案 1 :(得分:0)
您可以通过javascript / jquery(客户端站点脚本)来完成。
现场演示:
http://jsfiddle.net/5Y9mG/51/
HTML:
<input type="text" value="" id="country" />
<div id="needs" >You will have output here :</div>
<强> Jquery的:强>
$( document ).ready(function() {
$('input[id="country"]').on('keyup', function() { // on keyup event in your input field
$("#needs").append(this.value);// append values from input field
});
);
您希望将此值保存在php变量中,然后您需要ajax调用(无需提交表单),或者您需要提交表单。
对于基本的ajax,你可以读到这个:
http://www.tutorialspoint.com/jquery/ajax-jquery-post.htm
有用的jquery链接学习:
API文档:http://api.jquery.com/