Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Highlight Textbox upon show

Posted on 2009-07-07
9
Medium Priority
?
353 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
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 

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

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

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…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

610 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