...

View Full Version : Resolved button + jQuery + return false + function



ricmetal
07-03-2012, 02:47 AM
hi guys

i've attached an on click method to a html submit button via jQuery. this button runs a function and then a return false to avoid the button's default action.

thing is, attaching return false, via jQuery, after the function call does not avoid the button's default action, but if i omit the function call, returning false does indeed avoid the buttun's default action.

the same goes for adding return false to the button's html onclick attribute, while running the function, on click, set via jQuery. the button's default action is halted.

anyone explain this behaviour or point me in direction to some reading material?

Nile
07-03-2012, 03:00 AM
Have you tried http://api.jquery.com/event.preventDefault/

ricmetal
07-03-2012, 03:24 AM
yep, tried preventDefault.

worth noting that the function has no more than two var declarations, in order to keep debugging simple..

EDIT:

the error was human.
resolved
regards



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum