473,508 Members | 2,412 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Validation in ASP.NET. Need some help. Thank You.

Hello,

I have a form where I use the following tags:
Asp:Label, Asp:TextArea and Asp:ImageButton.

An example:
<asp:Label id="lmessage" runat="server">Message:</asp:Label>
<asp:TextArea rows="10" id="fmessage"></asp:TextArea>
<asp:ImageButton runat="server" id="submit"
ImageUrl="submit.gif"></asp:imagebutton>

I need to do the following when the send button is pressed:
If TextArea is empty.

1) Change text area background color to red.
2) Display message over text area: "Please Write your Message"
3) When the user places the mouse inside the text are the background
color changes again to the original color.

I have been making some tried in my aspx.vb code but until now I wasn't
able to understand how to create this.

Can somebody help me out?

Thanks,
Miguel
Nov 19 '05 #1
1 872
You will need to add some script to do this, it can't be done from the
server - side (for the most part).
So one approach is to handle the onclick event and put some javascript to
change the color etc

--
Regards,
Alvin Bruney - ASP.NET MVP

[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
Now available @ www.lulu.com/owc, Amazon.com etc
"Shapper" <mdmoura*NOSPAM*@gmail.*DELETE2SEND*com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
Hello,

I have a form where I use the following tags:
Asp:Label, Asp:TextArea and Asp:ImageButton.

An example:
<asp:Label id="lmessage" runat="server">Message:</asp:Label>
<asp:TextArea rows="10" id="fmessage"></asp:TextArea>
<asp:ImageButton runat="server" id="submit"
ImageUrl="submit.gif"></asp:imagebutton>

I need to do the following when the send button is pressed:
If TextArea is empty.

1) Change text area background color to red.
2) Display message over text area: "Please Write your Message"
3) When the user places the mouse inside the text are the background
color changes again to the original color.

I have been making some tried in my aspx.vb code but until now I wasn't
able to understand how to create this.

Can somebody help me out?

Thanks,
Miguel

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
2206
by: Drew Berkemeyer | last post by:
Hello, How can I use XSD to ignore certain nodes of an XML document. Specifically, we have an event that I want to define using XSD. I then want to validate incoming XML events with that XSD....
3
3030
by: Gary Varga | last post by:
In the file WebUIValidation.js, when a postback that doesn't fail the validation has a javascript error saying summary is undefined in the ValidationSummaryOnSubmit function....
6
3692
by: Nedu N | last post by:
Hi, I want to have confirmation(Yes/No) on a button of the webform in which there are many validation controls. I want all the validation controls to be triggered first and then Yes/No...
3
2862
by: Earl Teigrob | last post by:
Can a Modal Dialog Box do forms ASP.NET forms validation from within the Modal Box? I want to pop up a dialog box to the user and have it do its own post backs with validation checking and then...
3
1212
by: Shapper | last post by:
Hello, Could someone point me a good validation control for ASP.Net? Thank You, Miguel
2
1032
by: Saket Mundra | last post by:
I have following queries regarding Client side validation : 1) I am using a ASP.NET web Control on my form to submit the data entered by the user. I want to perform Validation when the user...
8
1771
by: john | last post by:
I need Help!!! Please I need to write a javascript that will do the following Show a user name User address User Phone Number City State zip code telephone number
5
1905
by: Peter Afonin | last post by:
Hello, I'm not an expert in Javascript, so I'm seeking an advice. As I mentioned in my previous post, I use Javascript to check whether at least one checkbox in the datagrid has been checked....
7
3581
ak1dnar
by: ak1dnar | last post by:
Hi, I got this scripts from this URL There is Error when i submit the form. Line: 54 Error: 'document.getElementbyID(....)' is null or not an object What is this error. Complete Files
3
6207
by: satishknight | last post by:
Hi, Can some one tell me how to change the validation sequence for the code pasted below, actually what I want it when any one enters the wrong login information (already registered users) then it...
0
7224
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7379
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7038
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...
0
5625
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5049
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3192
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3180
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1550
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
415
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.