How do I block a user from entering text in a text box if they type text in another text box?

I have two text boxes, and want the user to complete one or the other.  How can I "grey out" one text box if a user starts typing in the other textbox? 


Never make important decisions on a Monday!
0
funluckykitty
11/6/2008 8:32:15 PM
asp.net.getting-started 91979 articles. 3 followers. Follow

2 Replies
1556 Views

Similar Articles

[PageSpeed] 58

You can use the OnTextChanged event of the textboxes and write Javascript for both textboxes to disable the other textbox when the user starts to type in something in one textbox. The only problem with that is that once the user starts to type in something in one text box the other textbox gets disabled and locks up, so now the user HAS TO compulsarily type what he wants in the textbox that he first started typing in.

0
tejpalthatte
11/6/2008 8:43:31 PM

can you set autopostback and use ontextchanged event. maybe within a updatepanel to hide unsightly postbacks.


------------------------
if an answer, mark it so.
0
PaulSpencer
11/6/2008 8:47:11 PM
Reply:

Similar Artilces:

Text box submission being blocked by other text boxes
The following piece of code works:  1 ...2 <cc1:TabPanel runat="server" ID="CreateSubscriberTabPanel" CssClass="CustomTabStyle">3 <HeaderTemplate>4 Create Subscriber5 </HeaderTemplate>6 <ContentTemplate>7 <asp:UpdatePanel ID="CreateSubscriberUpdatePanel" runat="server" UpdateMode="Conditional">8 <ContentTemplate>9 <asp:Wizard runat="ser...

Bold Text For Selected text in Text Box
Hi EveryoneI have a small thing to do [at this time , very big for me]. I want to make some text string as bold which appears in a text box control for the web. It means some of the portion of the string will be bold and some will be in the normal font style. Can anyone suggest any idea to accomplish this task. [I know that we can set the font weight property for the whole text box and all the text appears in the selected font-weight]Any suggestions.BaberBaber SaeedSoftware EngineerPalmChip, Pakistan Toll Free: 0800-000-13 Ext:494Cell: 0300-6438634 Standard TextBox that comes with ASP.NET ...

Clear text on a text box when user click this box
There is a text box in which has default text "<Please enter your name>". How to clear this text when user click this box? one option might be to use the TextBoxWatermark from the ajax control toolkit http://www.asp.net/ajax/ajaxcontroltoolkit/samples/TextBoxWatermark/TextBoxWatermark.aspxMike Banavige~~~~~~~~~~~~Need a site code sample in a different language? Try converting it with: http://converter.telerik.com/ Basic idea:   <input type="text" value="first name" onfocus="if(this.value===this.defaultValue)this.value='&#...

fill text box from database as we type in the text box
We have a drug table that has thousands of medications...we want to display the list of drugs as we type in the characters in the text box..Can anyone give me the code to this or direct me .. Thanks, Prasad  Sure, check out the AutoComplete AJAX control http://asp.net/ajax/control-toolkit/live/AutoComplete/AutoComplete.aspx -DamienVisoft, Inc - Home | Blogs Latest Blog Post: SQL 2008 x64 and VS2008 SP1 you could also try this http://www.dotnetspider.com/kb/Article1699.aspx using xmlhttpobject directly..Please Mark Post that helped you as answer, also include a summar...

saving user entered text in a text box
 I created a text box for users to enter info into. I want to be able to save the entered text. I tried using databases but sometimes the text is too long to store in a table cell, only 255 characters in a cell, I think. so is there a way to store the text somehow?I don't care about saving any text that might have been entered before, they can add or erase previous entry's.Look forward to your replys. you can give a larger datatype to the column of the table in database. set it text, then it can accomodate a large amount of dataDiseirraMark it as an answer, if it helped you ...

populate text boxes based on what is typed in first text box.
I have a function that looks in tables and finds city, state, zipCode based on phone number.. I would like to have it autoPupulate these fields when the user types in the phone number. What would be the best way to go about this? 'Eventually i will have it populate a suggest drop down on each field...Applciation Developer CascadingDropDown sounds like the solution. It's part of ASP.NET AJAX Control Toolkit.--Ziya Hi there,If Im understanding u correctly, once text has been entered into one textbox, u want the same text to automatically reflect in another textbox?? if thats so...

Auto-populate text box based on another text box on the page
I have searched for methods to automatically populate a text box based within my web form.  I am trying to have it updated based on a text box that is not located within the form itself.  The trick is that I can do it like this: <asp:TextBox ID="TextBox1" runat="server" text= '<%# txtlocation.text %>' ></asp:TextBox><br /> But I also need the text value to bind to a data field like:  Text='<% #Bind("Location") %>' you can use TextBox1.Text = (PreviousPage.FindControl("") as TextBox).Tex...

Text as text
Name: JohnA Boice Email: jaboiceathughesdotnet Product: Firefox Summary: Text as text Comments: You need to do as Safari does and make ALL text, including buttons, links, bookmarks, and general page text actual text so screen readers can interpret and voice the text. Until this occurs, your products are a real pain to use. And I have limited sight. What about those with less or no sight? Browser Details: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3 ...

Text boxes and multiline text boxes under Macintosh
Hi to all ! I'm actually using Rainbow to build a website for a shop, which will be an Apple Authorised Reseller. So the website must be visually perfect on Macintosh under Safari browser, at least. The problem I have is simple: for example, the SendThoughts module, where we have text boxes and one multiline text box, is strangely rendered. The width has changed everywhere, and the look is not usable, because the multiline text box will take a half screen (in width), and the other text boxes are MUCH wider. I tried a html form thru an iFrame, and html code in html module, but the pr...

Selecting text on entering a text box
Hi,  I have many text boxes in my project. I know I can use the following code to select any text in the text box upon entering it:   Private Sub TextBoxTMax_Enter(ByVal sender As Object, ByVal e As System.EventArgs) Handles TextBox_TMax.Enter        TextBox_TMax.SelectionStart = 0        TextBox_TMax.SelectionLength = TextBox_TMax.Text.Length   End Sub  I could write one of these for each text box, but there must be a way to do it for all the text boxes on my form with fewer line...

How to identify when the text in a text box is edited by the user in VB.NET 2003?
Hi, My current scenario is as follows: I have a dropdownlist which has autopostback enabled. Every time the dropdownlist index is changed, I have a textbox which gets populated with the dropdownlist selecteditem text and the textbox is editable by the user. My requirement is:  Until the user doesn't change the text in the textbox, the textbox will keep on getting populated with the dropdownlist selected item text. But, when the user changes the text in the textbox, any change in the dropdownlist selected index shouldn't change the textbox value. In other words, t...

Text not appearing when typing the text into text field
Name: Maadhavan Email: madhavan_t_patyahoodotcom Product: Firefox Summary: Text not appearing when typing the text into text field Comments: Text not appearing when typing the text into text field or any other field Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.9) Gecko/2009040821 Firefox/3.0.9 From URL: http://hendrix.mozilla.org/ Note to readers: Hendrix gives no expectation of a response to this feedback but if you wish to provide one you must BCC (not CC) the sender for them to see it. ...

Ritch Text Box control from Free Text Box
I have a client that is complaintaning about how hurd it is to format a html page with that tool it is great for someone like us who knows how to work with HTML and all that.. is it a good program or tool that i can show him so he ca format a page for easily ?? right now is using Word and do a copy paste..but its not showing off the same thing... thanx.I like programming If he is using word you might want to look at this... Peters MHTML Control Cheers, Dave...

Issues with overlapping text when typing in text boxes
I know this is a problem a few people have had - but I don't think too many. I get a weird issue with text overlapping each other when i type into any large text space in firefox. It happens in gmail, it happens in facebook & it's even happening as I type now. I did find an answer in the mozilla help forum, but tried it and no fix. This is exactly the problem i'm talking about: http://kb.mozillazine.org/Text_overlaps_on_Mac . I would really appreciate if one of you could give me a hand with this...as you can imagine, it's a real pain in the backside when i w...

Web resources about - How do I block a user from entering text in a text box if they type text in another text box? - asp.net.getting-started

Entering heaven alive - Wikipedia, the free encyclopedia
Entering heaven alive (called by various religions "ascension", "assumption", or " translation ") is a belief held by multiple religions and ...

3Q EARNINGS: Facebook Not Entering the Payments Business on Its Own
Facebook co-founder and CEO Mark Zuckerberg said during the company’s third-quarter earnings call Tuesday that he envisions Facebook as a collaborator ...

Facebook, Box, Pinterest partner to form WEST: Women Entering and Staying in Tech
Facebook today announced a partnership with Box and Pinterest, creating WEST — Women Entering and Staying in Tech. Facebook discussed the new ...

Entering Hyperspace - Flickr - Photo Sharing!
In Toulouse, southern France, the unique metro line is entirely driven by computers. There's no human driver. So you go to the front and see ...

Dorothy entering Technicolor - YouTube
This is the famous scene in which Dorothy walks out her front door into Oz and for the first time sees the world in Technicolor. I am uploading ...

Man denies re-entering UAE under different name
An Indian denies entering the country under a different name after previously being deported, a court hears.

Odds rise for fiscal cliff entering 2013
The "fiscal cliff" impasse is raising the odds that Congress will fail to meet a year-end deadline to avert steep tax hikes and budget cuts that ...

Freedom Flotilla to West Papua entering Indonesian waters - Video
Six protesters aboard the Freedom Flotilla to West Papua are poised to cross into Indonesian waters, despite the government's warnings of a military ...

'UNHINGED': Republicans turn on Trump after he calls for a 'shutdown' of Muslims entering the US
... presidential candidates... Fellow Republican presidential candidates are slamming Donald Trump’s proposal to temporarily ban Muslims from entering ...

Entering an era of bigger monsoons
A new study suggests monsoons may be more sensitive to global climate change than scientists previously thought, with Asia's big rains to increase ...

Resources last updated: 1/14/2016 4:08:49 AM