473,395 Members | 1,631 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Stop input while postback is processing

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 ?

--
Adrian Parker
Ingenuity At Work Ltd
Mar 1 '06 #1
5 1767
Hi Adrian,

What you could do is make a javascript that loops through all the form
controls and sets them to read-only. Fire this javascript in the onclick
event for the submit button.

--
Ward Bekker
"Asp.Net Discussions for the Professional Developer"
http://www.dotnettaxi.com

"Free .Net 2.0 C# to/from VB.Net Code Converter"
http://www.dotnettaxi.com/Tools/Converter.aspx

Mar 1 '06 #2
We're not always using a submit button, sometimes it's an itemchanged event that is causing the postback.

"Ward Bekker" <wa**@NOequanimitySPAM.nl> wrote in message news:44**********************@news.kpnplanet.nl...
Hi Adrian,

What you could do is make a javascript that loops through all the form controls and sets them to read-only. Fire this javascript
in the onclick event for the submit button.

--
Ward Bekker
"Asp.Net Discussions for the Professional Developer"
http://www.dotnettaxi.com

"Free .Net 2.0 C# to/from VB.Net Code Converter"
http://www.dotnettaxi.com/Tools/Converter.aspx

Mar 1 '06 #3
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.)

Mar 2 '06 #4
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)
"Steven Cheng[MSFT]" <st*****@online.microsoft.com> wrote in message news:1C*************@TK2MSFTNGXA03.phx.gbl...
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.)

Mar 2 '06 #5
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.)

Mar 3 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Steven Spits | last post by:
Hi group, We've developed a rather large ASP.NET WebApp with *A LOT* of input-fiels. Many of these fields have AutoPostBack set to true. I want to block all user input when the form is...
4
by: Jim Hammond | last post by:
It would be udeful to be able to get the current on-screen values from a FormView that is databound to an ObjectDataSource by using a callback instead of a postback. For example: public void...
2
by: TS | last post by:
when i try to do a response.flush and .end, the screen ends up blank. I want all page processing to quit when a check in the pageload event fails. Since control events occur after load, how do i...
0
by: ThunderMusic | last post by:
Hi, I have a page where I have an input type=file control and many other controls... the thing is, when I cause a postback by any control on the page, if a file is selected in the input...
2
by: Nathan Sokalski | last post by:
I have a DataList in which the ItemTemplate contains two Button controls that use EventBubbling. When I click either of them I receive the following error: Server Error in '/' Application....
8
by: Richard Maher | last post by:
Hi, I am in a mouseup event for button A and I'd like to disable=false button B before starting some work. Is there anyway that an event for button B can then fire before my event processing for...
1
by: mark4asp | last post by:
<form runat="server"automatically adds <divtag to code contained within. Is there a way to stop that? Mixing block-level elements with inline-level elements messes up the HTML becasuse that is...
1
by: =?Utf-8?B?S2VuIEFkZW5pamk=?= | last post by:
I read, How can I update my user interface from a thread that did not create it? http://blogs.msdn.com/csharpfaq/archive/2004/03/17/91685.aspx I have a postback event handler, that requests user...
1
BeemerBiker
by: BeemerBiker | last post by:
I am using CancelAsyncPostback in an attempt to stop a page from loading. It actually works (the page wont get a postback) but the server keeps running, processing data I dont want processed until...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.