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
Post a Comment