kmk21
10-21-2010, 08:19 PM
I am having a problem pulling the value from a text input from a form. The line is in bold below.
The jquery:
$(document).ready(function( numberInput ) {
var numberInput = $("#numberInput").val();
senddata = function() {
$.post("post.php", { number: numberInput }, function(data) {
$("#results").replaceWith(data);
});
}
});
The Form:
<form name="form">
<input id="numberInput" type="text">
<input onclick="senddata();" type="button" value="send data">
</form>
Anyone have any ideas?? Help would be much appreciated.
The jquery:
$(document).ready(function( numberInput ) {
var numberInput = $("#numberInput").val();
senddata = function() {
$.post("post.php", { number: numberInput }, function(data) {
$("#results").replaceWith(data);
});
}
});
The Form:
<form name="form">
<input id="numberInput" type="text">
<input onclick="senddata();" type="button" value="send data">
</form>
Anyone have any ideas?? Help would be much appreciated.