At the moment I am just trying to get jquery to show an alert when my submit button is pressed in my form, I have given it an id
<%= submit_tag "search", :id => 'submitForm' %>
and tried this
$(document).ready(function() {
$('#submitForm').submit(function(e) {
e.preventDefault();
alert('clicked');
});
});
but i get no alert, I have also tried
$(document).ready(function() {
$(':input#submitForm').submit(function(e) {
e.preventDefault();
alert('clicked');
});
});
but this doesnt work either..is there anything i am doing that is obviously incorrect
Thanks