Daaka Daaka - 1 year ago 63
Javascript Question

How to prevent defaut behaviour of "input submit"?

I have an input submit, after attaching an onclick handler on it, what's the standard way to prevent a post request to "form action=xxx" url? Is it "return false", or "e.preventDefault", or "e.stopPropogation"?

Answer Source

just call preventDefault() like this


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download