Reputation: 31749
i have added to the beginning of my code this great script below.
<script type="text/javascript">
alert("pippo");
</script>
And it works: when i load the page it shows a small window with "pippo".
If i I add this below after the alert:
$(document).ready(function()
// validate signup form on keyup and submit
$("#foo").validate({
rules: {
'telephone[number]': {
number: true
}
},
messages: {
'telephone[number]': "Please enter a telephone number"
}
});
});
and reload the page it doesn't show "pippo" any more..Why?
Regards
Javi
Upvotes: 1
Views: 123
Reputation: 455460
That is because your program has a syntax error of missing {
after
$(document).ready(function()
Upvotes: 0
Reputation: 14953
You have a syntax error, missing { after function(). Also, make sure that you have included jquery.
Upvotes: 0
Reputation: 26740
It's because you must have some invalid code which is failing to be parsed by the engine, first step: do you have jQuery loaded?
Upvotes: 1
Reputation: 13804
$(document).ready(function() { // <-- missing opening {
// validate signup form on keyup and submit
$("#foo").validate({
rules: {
'telephone[number]': {
number: true
}
},
messages: {
'telephone[number]': "Please enter a telephone number"
}
});
});
Look at the first line, works fine when fixed.
Upvotes: 5