472,779 Members | 2,050 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,779 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 1778
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: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

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.