Hi ,
m writing a code to add some dynamic values , following is my code which is currently hardcoded
<!DOCTYPE html>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js">
</script>
<script>
$(document).ready(function(){
$("button").click(function(){
$.post("Myfile.php",
{
name:"Donald Duck",
city:"Duckburg"
},
function(data,status){
alert("Data: " + data + "\nStatus: " + status);
});
});
});
</script>
</head>
<body>
<button>Send an HTTP POST request to a page and get the result back</button>
<input type="text" id="txt1">
</body>
</html>
Now i want to send some value in city : entered from the text filed , i used
city :$('input[type=text]').val() but it did not work Please Suggest.
Thanks!!!