I have a form which is sending data to another script with AJAX post. Idea is to change this to GET, so I can submit form or trough form input where user click "Submit" or just hit "Enter", and form data is passed with AJAX to another script, and data is returned to origin script.
What I want is to make user able just to type parameter in url, like whois.com/domain.com, and just hit enter, so my form can be autopopulated with data in url and submitted, so my JS can be trigerred to make AJAX call.
<script>
$('#form1').submit(function(event) {
event.preventDefault();
$.ajax({
type: 'GET',
url: 'check.php',
data: $(this).serialize(),
success: function (data) {
//console.log(data);
$('#response').html(data);
$("#myModal").modal();
}
});
});
</script>
Idea: Check if $_GET['variable'] is set in url yoursite.com?domain=domain.com, and then pass variable to form, and submit form by code?