473,395 Members | 1,466 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How to Display Text in TextBox in Web Application

16
Hi

Pls Any One Solve My Problem.

One Text box for Enter user Name.My Requirement is if web application is Run then, In Textbox Display "Pls Enter User name" If Click By Mouse the text Is Gone.If Enter Usename, If In Case Do Not Enter User Name, Again Come And Display "Pls Enter User Name"


Thanks & Regards
Atul Singh
Sep 21 '07 #1
4 1807
Hi

Pls Any One Solve My Problem.

One Text box for Enter user Name.My Requirement is if web application is Run then, In Textbox Display "Pls Enter User name" If Click By Mouse the text Is Gone.If Enter Usename, If In Case Do Not Enter User Name, Again Come And Display "Pls Enter User Name"


Thanks & Regards
Atul Singh
hi Atul u do this work on pageload.....by default enter "Pls Enter User name" 'd by jusing javascript on mouseclick event of textbox jst clear it 'd write whatever u want to write....'d then i suppose there is submit event on this check that textbox contents if it is equalt to ur "Pls Enter User name" this then send message enter correct username 'd tell me this help u or not


enjoy coding.....
Navneet
Sep 21 '07 #2
singh79
16
Ok,

I Agree With u...

But How ,Pls Give Me Code And How To Call Java Script In Page Load..

Full Code.Any One Display.....

Pls Help Me..
Regards
Atul Singh
Sep 24 '07 #3
krris
10
Textbox :
<asp:TextBox ID="txtFirstName" runat="server" CssClass="h_flattxt" Width="99px" onblur="DisplayMsg(this)" onfocus="DisplayMsg(this);">FirstName</asp:TextBox>



Code for javascript
in function DisplayMsg(TxtName)
if(TxtName.value.length > 0)
{
if(TxtName.value != 'FirstName' && TxtName.value.length > 0)
{
TxtName.value = TxtName.value;
TxtName.className = 'flattxt';
}
else
{
TxtName.value = '';
TxtName.className = 'flattxt';
}
}
else
{
TxtName.value = 'FirstName';
TxtName.className = 'h_flattxt';
}
Sep 24 '07 #4
singh79
16
Pls I Am Sorry That..

This Code is Not Run ...
Pls Give Me Details How To Run ..

I am Written Same Code sending By U But Not Run ..


Pls Give Me Proper Solution....


Regards
atul
Sep 26 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: bala | last post by:
hi!!! i need to display a disclaimer which is two page in length in a word document. i also need to format the text. the idea is something as follows on opening the application, a form which...
4
by: Tom | last post by:
Hi, I want to display a text "Hello" in a textbox for every 30 seconds. How can I do this? I saw the code static void Main() {
1
by: Tom | last post by:
Hi I want to display the DB data in a tabcontrol. There is a textbox insides that tabcontrol <code private void Bind_DBData( string strSql = "select * from table WHERE id > 0 order by id"...
4
by: Joe Van Meer | last post by:
Hi, Is the datalist meant for one table or can I use it to display information from 2 different tables? Or should I be looking at a datagrid instead? I began my code and kinda ran into a snag...
2
by: Mamatha | last post by:
Hi I want to add an icon to the textbox's text. I don't know how to display icon in textbox in VB.NET. If any one knows please let me know. Thanks in advance. Mamatha
0
by: Luke Herbert | last post by:
I am very new to C# and have been trying to get to grips with it by writing a small tool to detect a USB key being inserted and then backup user specified files to the key. I have written some...
3
by: remya1000 | last post by:
i'm using ASP with MSAccess as database. i have two buttons and two textbox in my page. when i press my first button (First month) i need to display the current month in one textbox and last one...
0
by: rehanmomin | last post by:
Just to start off, I am writing a web application using C#. I have a Menu which is binded to an XML datasource. There are three menu items each with submenus and a textbox where I want to display...
9
by: tshad | last post by:
I have a Windows App that is doing some work and then writing a "Now Processing..." line to the status line of the window as well as the Textbox on the form. But the problem is that the work is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.