I am trying to submit a form without page refresh or a submit button. But i have only achieved to have the JS function submit the input box value. Is it possible to submit the whole form without a button click and refresh of page?
JS
<script type="text/javascript">
$(document).ready(function() {
var timer;
$('#yurl).on('keyup', function() {
var value = this.value;
clearTimeout(timer);
timer = setTimeout(function() {
//do your submit here
alert('submitted:' + value);
}, 2000);
});
});
</script>
html
<form method="post" id="ytVideo" action="">
<input id="yurl" type="text" value="<?php $url ?>" name="yurl">
</form>