I have a textarea where people can write comments and click a button to post them. The processing is done with AJAX and so I want that as long as the server is processing the user request (and af开发者_开发问答ter too), the button and textarea will be blocked for editing/writing/clicking.
It's very similar to how comments on Youtube videos work.
Do you have an idea how to do this? I'm very new to ajax and so I would appreciate a detailed response,
thanks!
Its simple Gal, On button click
document.form.myTextArea.readOnly=true;
If you did no one can edit and also you change the color of the textbox
document.getElementById('myTextArea').style.background = "#FF0000";
Gal,
You can use update progress to disable buttons or textareas.
http://www.asp.net/Ajax/Documentation/Live/overview/UpdateProgressOverview.aspx
It's the easiest!
before you make ajax call, in the javascript function from which you will make ajax call, you can grab the textarea or button by document.getElementById('idOfTextAreaOrButton') method and set the disabled property to true.
精彩评论