Phil Jackson
09-21-2009, 10:22 AM
Hello all i have the following:
$(document).ready(function(){
$("#getInfo").bind("click", function(){
var keyword = $("#keyword").val();
$("#content").html('Gathering data... <img src="loader.gif" />');
$.ajax({
type: "GET",
data: 'keyword=' + keyword,
url: 'proccess.php',
cache: false,
error: function(html){
$("#content").html(
"<span class=\"red\">Error: Network connection low, please try again later.</span>" + html
);},
success:
function(html){
$("#content").html(html);
}
});
});
});
setTimeout(ready, 500000);
When a button is clicked, away it goes. But if you type info in the input box, and press enter, obviously nothing happens. how do i activate function when data is inserted and then enter is pressed?
$(document).ready(function(){
$("#getInfo").bind("click", function(){
var keyword = $("#keyword").val();
$("#content").html('Gathering data... <img src="loader.gif" />');
$.ajax({
type: "GET",
data: 'keyword=' + keyword,
url: 'proccess.php',
cache: false,
error: function(html){
$("#content").html(
"<span class=\"red\">Error: Network connection low, please try again later.</span>" + html
);},
success:
function(html){
$("#content").html(html);
}
});
});
});
setTimeout(ready, 500000);
When a button is clicked, away it goes. But if you type info in the input box, and press enter, obviously nothing happens. how do i activate function when data is inserted and then enter is pressed?