Stop input while postback is processing

A

Adrian Parker

Say I have a form with several fields on it, some of which cause postbacks when changed. How can I stop the user from continuing
to type data into the other fields while the server is still processing the postback ?
 
A

Adrian Parker

We're not always using a submit button, sometimes it's an itemchanged event that is causing the postback.
 
S

Steven Cheng[MSFT]

Hi Adrian,

If the postback is not always caused by submit button, but also could be
caused by other controls like textbox or dropdownlist(autopostback), you
can consider use the <form> element's "onsubmit" client event to set those
text fields's readOnly property.

Hope this helps.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
A

Adrian Parker

Any problem using the following ?

function ignoreinput() {
return false;
}
function stop_input() {
window.attachEvent(""onkeydown"", ignoreinput);
window.attachEvent(""onclick"", ignoreinput);
}

then in the form element add the tag onsubmit="stop_input();"

(NB. we only support IE)
 
S

Steven Cheng[MSFT]

Thanks for your response Adrian,

It is recommended you have a test, and I think you may need to attach the
event for each individul input element. BTW, if you just want to prevent
input in the text fields, you can make them readonly.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top