I have a C#.Net MVCV3 web app. There is a requirement that, when a user changes the text in a text box and tabs out of the text box, the app needs to update either modify the title of the page by appending a “*” to indicate the page is in need of saving…..OR…enable the Save button to indicate the page needs to be Saved. I don’t know how to do this in the client code without submitting the form. Any ideas?
Editting to reflect summary of comments with 3nigma. The keyup and change functions needed to be added to either the Window.Load event or the document.ready event:
$(window).load(function () {
$("#Description").keyup(function (e) {
$("input[type='submit']").removeAttr("disabled");
document.title = document.title + "*";
});
});
OR
$(document).ready(function () {
$("#Description").keyup(function (e) {
$("input[type='submit']").removeAttr("disabled");
document.title = document.title + "*";
});
});
you can use jquery for that, on document ready disable the submit button
bind a change event to the fields that the user can change like
textboxor append a
*like