Link to home
Create AccountLog in
Avatar of smartkitty
smartkitty

asked on

function not recognized

Hi experts,

I have a textbox (id="postal") in a form, and i want to call a ajax function using keypress event.
keypress="foo()", but when i deploy it, the function foo is not recognized. function foo() is inside the JQuery $(document).ready(function(){
......
function foo(){
......
}
});

Any ideas? Thanks.
ASKER CERTIFIED SOLUTION
Avatar of AlfredRobot
AlfredRobot
Flag of Canada image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of amit_g
Move the function outside of the ready event handler.
Avatar of smartkitty
smartkitty

ASKER

thanks