Getting null values when using ajax serialize method

713 views Asked by At
<script>
$( document ).ready(function() {
$("#inputval").ready(function(){
var querystring = $(this).serialize();

alert(querystring);
$.ajax({
url: "/example",
type: "POST",
data: querystring,
})

});
});

</script>

` this is the script am using. someone kindly help me to find out what am doing wrong.

1

There are 1 answers

0
DinEsh On BEST ANSWER
<script>
$( document ).ready(function() {

var querystring = $("#inputval").serialize();

console.log(querystring);
$.ajax({
url: "/example",
type: "POST",
data: querystring,
})

});

</script>

Credits & thanks to- http://stackoverflow.com/users/4114297/paulgv