html5 - jQuery data-action="save" button not posting for specific browsers -


I have a form that captures the signature and posts it in an MVC 4 controller action Works on IE, but not Chrome, or some mobile device. Any ideas why does not post it, or submit the form on some devices?

Here is the relevant code:

  & lt; Form action = "/ capture / save" id = "formSig" method = "post" & gt; ... & lt; Button ID = "BTN service" class = "save button" data-action = "save" onclick = "SaveButton_Click returns;" & Gt; Save & lt; / Button & gt; & Lt; / Form & gt; & Lt; Script type = "text / javascript" & gt; SaveButton_Click () {$ ("# btn save") function. Attr ('disabled', 'disabled'); Back true; } & Lt; / Script & gt; By disabling the button  

, you can effectively cancel the occurrence (Test only for me in Chrome, 1 negative result is enough for me). You must use the submitted event to disable the button.

  & lt; Form action = "javascript: alert ('Hello World!')" Onsubmit = "Return formsig_submit ()" id = "formSig" method = "post" & gt; ... & lt; Button ID = "BTN service" class = "button" data-action = "save" & gt; Save & lt; / Button & gt; & Lt; / Form & gt; & Lt; Script & gt; Function FormSig_Submit () {$ ("# btn save"). Attr ('disabled', 'disabled'); Back true; } & Lt; / Script & gt;  

It would also be better (in my opinion) to not use inline events and .prop instead of .attr .

  & lt; Form action = "javascript: alert ('Hello World!')" Id = "formSig" method = "post" & gt; ... & lt; Button ID = "BTN service" class = "button" data-action = "save" & gt; Save & lt; / Button & gt; & Lt; / Form & gt; & Lt; Script & gt; $ (Document) .ready (function () {$ ("# formSig"). Submit (function () {// $ ("#btnSave"). Attr (disabled ',' disabled '); $ ("# BtnSave ") .prop ('disabled', true);});}); & Lt; / Script & gt;  

Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -