Solved

Highlight Textbox upon show

Posted on 2009-07-07
9
339 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
 

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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

762 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now