javascript - Tab onto ASP button and press enter to fire button doesn't fire onClick -



javascript - Tab onto ASP button and press enter to fire button doesn't fire onClick -

i have asp button created server side , have set onclientclick event fire javascript function. renders on page onclick event correctly containing phone call javascript function , when click button works should.

the problem occurs when tab onto button , press come in key. submits form, doesn't fire onclick event, javascript isn't beingness called.

i have tried assign onkeypress , onkeydown button, that's not worked. must simple i've missed, i'm drawing blank here.

any help gratefully accepted, thanks.

here html generated button:

<input type="submit" name="savebuttontop" value="save" onclick="javascript:return clicksubmitbtn();webform_dopostbackwithoptions(new webform_postbackoptions(&quot;savebuttontop&quot;, &quot;&quot;, true, &quot;&quot;, &quot;&quot;, false, false))" id="savebuttontop" />

you using submit button, hence submit. must cancel default action of button event in function calling, or utilize regular button, not submit.

see: http://css-tricks.com/return-false-and-prevent-default/

javascript button onclick keypress

Comments

Popular posts from this blog

web services - java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

Accessing MATLAB's unicode strings from C -

javascript - mongodb won't find my schema method in nested container -