Solved

Highlight Textbox upon show

Posted on 2009-07-07
9
345 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

832 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