jquery - Can't handle submit function -


i want show error message viewbag can't handle button click function. couldn't find reason. aim show viewbag message if isn't null.

in view:

  $(function () {                     $("#changecompanyuserinfobutton").submit(function (e) {                 e.preventdefault();                 var deneme = viewbag.messageforallres;                 if(deneme != null)                 alert(deneme);                         });         });   <button type="submit" id="#changecompanyuserinfobutton">changecompanyuserinfovalues</button> 

just remove hash(#) id in html , see works.

<button type="submit" id="changecompanyuserinfobutton">changecompanyuserinfovalues</button> 

Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -