Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Highlight Textbox upon show

Posted on 2009-07-07
9
346 Views
Last Modified: 2012-05-07
I am still using asp.net 1.1 so I know this is easier in 2.0 when my company gets there someday.
But what I have is a textbox that is shown when a panel called pnlSearch is called visible it show a textbox called txtSearch.  In here I put the letters Enter SSN.  What I need to do is highlight, focus and remove those letter as soon as they start typing in there.
Easiet way to do this possible, I am not a big javascript guru.  I am using Vb.net
thanks
0
Comment
Question by:kdeutsch
  • 4
  • 2
  • 2
  • +1
9 Comments
 
LVL 14

Expert Comment

by:shahprabal
ID: 24796205
0
 
LVL 14

Expert Comment

by:shahprabal
ID: 24796242
Also if you see the comments you will need to add the classes to your solution as the solution file wont open with vs2003.
0
 
LVL 21

Expert Comment

by:Tapan Pattanaik
ID: 24796312
hi kdeutsch,

                Check these useful link. Hope these are helpful.

Text box OnClick event to remove default data:

http://www.plus2net.com/javascript_tutorial/text-onclick.php


Javascript - Delete a field of a form when clicking (focus):

http://en.kioskea.net/faq/sujet-1824-javascript-delete-a-field-of-a-form-when-clicking-focus

Clearing Default Text:

http://www.yourhtmlsource.com/forms/clearingdefaulttext.html

Thanks
0
MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

 

Author Comment

by:kdeutsch
ID: 24796325
Hi,
The way he is using this will not work for me, it looks to be a 2.0 oriented solution.
0
 
LVL 22

Expert Comment

by:prairiedog
ID: 24796708
>>>I am not a big javascript guru.  I am using Vb.net
Does it mean JavaScript is not an option for you?

0
 

Author Comment

by:kdeutsch
ID: 24797019
Hi,
I would use if easy to understand, really ahve not gotten into a lot of javascript, but run into a lot of examples that do not work with 1.1 but with 2.0 and I don't know how to change them because of lack of knowledge.  Something I need to get working on.  So if its easy yes.
0
 
LVL 22

Expert Comment

by:prairiedog
ID: 24797070
Can you post the code when you make pnlSearch and txtSearch visible?
0
 

Author Comment

by:kdeutsch
ID: 24803205
Private Sub myDataGrid_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles myDataGrid.ItemCommand
        Dim PositionID As String = e.Item.Cells(0).Text
        Dim Para As String = e.Item.Cells(1).Text
        Dim Line As String = e.Item.Cells(2).Text
        Dim PositionNum As String = e.Item.Cells(3).Text

        If (e.CommandName = "Fill") Then
            pnlStart.Visible = False
            pnlSearch.Visible = True
            BuildDDSSN()
            lblHiddenId.Text = PositionID
            lblPara.Text = Para
            lblLine.Text = Line
            lblPosition.Text = PositionNum

        End If
    End Sub
0
 

Accepted Solution

by:
kdeutsch earned 0 total points
ID: 24804740
I figured it out using the Attriburtes feature of Vb.net

  txtSearch.Attributes("Onfocus") = "if(this.value == 'Enter SSN'){this.value = ''}"
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question