Wednesday, 7 August 2013

Jquery on submit not responding

Jquery on submit not responding

so I have a form wuth a button. On click i need to use to run some google
analytics code (_gap.push). This wasnt working so I have decided to do an
alert to do some test. The alert showing the word "outside" works however
the alert showing the word "inside" is not working. So that means that it
is not going into that function
Js code
applyRegisterNewUserListener: function() {
alert ("outside")
// Form that attempts to register users
$(document).on('submit', 'form#signup-form', function() {
alert ("inside"
_gaq.push(['_trackEvent', 'register', 'account', 'form',,
false]);
})
},
html
<form method="post" id="#signup-form">
<input type="submit" value="submit">
</form>
I really cannot understand what is the problem. The function is being
called too.

No comments:

Post a Comment