I have form:
<form id="search_user" name="search_user" method="post" action="<?php echo base_url();?>index.php/controller/function">
<input type="submit" name="submit" id="submit" value="Submit Search" />
</form>
<script type="text/javascript" src="<?php echo base_url(); ?>js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>js/content1.js"></script>
here is my jquery;
$(':submit').submit(function () {
var linkme = $(this);
var url = linkme.attr("href");
$(".content").load(url);
return false;
});
When I press the button submit nothing happens. Please need your advice
$('#search_user').submit()(':submit')re... can't you upgrade & look at the latest jquery ways to bind events (delegating with.on()?action) is fixing it then there is no need to upgrade jQuery just for the sake of it. Even if the elements are injected dynamically it is still possible to bind withoutonwith delegation by placing the bindings into the right place. Though I do agree that if starting something new it's always nice to be able to start with the latest jQuery version.