473,386 Members | 1,736 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,386 software developers and data experts.

Highlight Required Field When Not Validated

I'd like to highlight any required fields that don't pass validation by
changing their labels to red, and I prefer to do this client-side. I was
hoping to do this with a CustomValidator, but the client-side script doesn't
run unless there's actually a value in the field. Any suggestions? Is there
any other way to do a client-side validation before calling my save method
on the server?

Thanks in advance.
Nov 19 '05 #1
5 1708
sam
My suggestion is to modify or replace the offending Microsoft client
side code to not check for an empty value. This is what we did where I
work.

My understanding is that in ASP.NET 2.0 they have an option that allows
this. Maybe you can use that instead.

Nov 19 '05 #2
"sam" <sa*************@gmail.com> wrote in message
My suggestion is to modify or replace the offending Microsoft client
side code to not check for an empty value. This is what we did where I
work.
Where do you do that?

My understanding is that in ASP.NET 2.0 they have an option that allows
this. Maybe you can use that instead.


I'm not using 2.0 at this time.
Thanks for the reply.
Nov 19 '05 #3
sam
Its in WebUIValidation.js which will be under your Inetpub directory a
couple folders down. Just trace the functions starting with
Page_ClientValidate or whatever its called in the __doPostback
javascript function which you can see by doing a view page source.

Easiest way to see the offending line is to set a break point in the
aforementioned function and just step into the javascript functions
when the empty textbox doens't get validated (I remember the function
is called CustomValidate or something like that).

Anyway, its pretty straightforward. At work here all of our postback
controls call TPageClient_Validate() rather than the one ASP.NET one.
Most of our javascript funcitons are copied from ASP.NET except for
little changes like you've noticed. But there is no reason why you
can't simply edit the WebUIValidation.js file.

Nov 19 '05 #4
"sam" <sa*************@gmail.com> wrote in message
Its in WebUIValidation.js which will be under your Inetpub directory a
couple folders down. Just trace the functions... [snip]


Thanks!

Nov 19 '05 #5

"sam" <sa*************@gmail.com> wrote in message
Its in WebUIValidation.js which will be under your Inetpub directory a
couple folders down... [snip]


Thanks!
Nov 19 '05 #6

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

Similar topics

5
by: Red | last post by:
Hi, I'm not very familiar with Javascript. I usually leave that kind of stuff up to Dreamweaver, but i'm starting to need a little more than it can offer. I have an asp page which creates a...
1
by: john woo | last post by:
Hi I'm not good at JS, but want to get more about it. I want to use a JSP (the java code just used to get date, the rest are html and javascript), to display a table. the requirement is the...
1
by: Not Me | last post by:
Hey, In our database, we have implemented auditing simply by holding a copy of each row of the specific table at any time that data is updated. This gives us a long list of full records, often...
3
by: Srinivas | last post by:
Hi If a textbox is being validated using a required field validator then we need to key in some text before sumbmitting the form. But if we key in a space character this gets validated to true...
1
by: WJ | last post by:
My users want to display the text value of all the "Required Field Validation controls" at all time , so I set them all to "Static" but they donot showup until the submit button is pressed. And...
3
by: tshad | last post by:
Can you use a Required Validator on a CheckBoxList? You can on a RadioButtonList. But when I try on my CheckBoxList I get the error: Control 'RFPServiceTypes' referenced by the...
0
by: misra | last post by:
Hi, I am using a C# code to call blat and send mail. When I send mails with long sentences, the mail automatically is send with multiple lines. However, certain times the body and format of the...
1
by: onseats.ky | last post by:
I have a strange problem with a required field validator when I have EnableClientScript set to true. When the client side validation fires I get a javascript exception inside the .net javascript....
5
by: Cubicle Intern | last post by:
Hi, I have a form with multiple fields that confirmed before the form is submitted (ex. email field needs to be completed before the form can be submitted). Once the required fields are...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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...

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.