?
Solved

Highlight Textbox upon show

Posted on 2009-07-07
9
Medium Priority
?
351 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
[X]
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
  • 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
Use Filtering Commands to Process Files in Linux

Learn how to manipulate data with the help of various filtering commands such as `cat`, `fmt`, `pr`, and others in Linux.

 

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

765 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