how to target
<input type="submit" value="submit" />
to the <form>
using the ajax. heres my code below:
$(document).ready(function(){
$("#loading").hide();
<?php $type_temp = (!empty($type)) ? 'company/' .$type:'company';?>
$("#search_id").click(function(){
$("#loading").show();
$("#tbl").hide();
$.get("<?php echo url_for('/AdmSys_dev.php/' .$type_temp); ?>", $("#send_search").serialize(), function(data){
//alert(data);
$("#tbl").show();
$("#sf_admin_content").html(data);
});
});
});
the html code below:
<div style="margin-bottom:20px;">
<form id="send_search" action="" method="get">
<input type="text" name="search" placeholder="Search: " value="<?php echo $search; ?>" />
<input id="search_id" type="button" value="Search" />
</form>
</div>
there as youve notice my input type is button i want that to be input type submit i want to target the input type submit to the form using the jquery above...
You can use form id attribute to so when you click on submit jquery submit form with ID passed.
<input id="search_id" type="submit" value="Search" />
Jquery
$('#send_search').submit(function(){
});
without additional modification to your html form you can access it by
":submit"
$(":submit").click()