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

RequiredFieldValidator doesn't show error message and missing __postback function


I have a webpage which has a few asp:textbox's and an asp:button. I also
have a few RequiredFieldValidators for these text boxes. When I click on
the button while the textboxes are empty, I don't see any error messages
from the validators. I noticed the __doPostBack function is also missing
along with the two args in the source.

I thought a button adds this function. When I changed a textbox to
autopostback, the function appeared. But I don't want to autopostback and
the error messages still don't show up.

I have display set to dynamic, enabled is true and enableclientscript is
true.
Any clues?

J.
Nov 18 '05 #1
2 3732
Make sure on your Postback that:

Post.IsValid = true

you could place this in Page_Load method

"John Sutter" <jo*****@yahoo.com> wrote in message
news:1m***************************@40tude.net...

I have a webpage which has a few asp:textbox's and an asp:button. I also
have a few RequiredFieldValidators for these text boxes. When I click on
the button while the textboxes are empty, I don't see any error messages
from the validators. I noticed the __doPostBack function is also missing
along with the two args in the source.

I thought a button adds this function. When I changed a textbox to
autopostback, the function appeared. But I don't want to autopostback and
the error messages still don't show up.

I have display set to dynamic, enabled is true and enableclientscript is
true.
Any clues?

J.

Nov 18 '05 #2
From what you have described, the system doesn't think Client-side
validation needs to be setup for the submit button.

There are two possibilities
1. The button has CausesValidation=false. This omits the call to
Page_ClientValidate() and thus prevents client-side validation.
2. The page thinks the browser isn't IE. The ClientTarget on the page may
not be blank. It may reflect something like "Downlevel". Client-side
validation requires detection of IE.

--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"John Sutter" <jo*****@yahoo.com> wrote in message
news:1m***************************@40tude.net...

I have a webpage which has a few asp:textbox's and an asp:button. I also
have a few RequiredFieldValidators for these text boxes. When I click on
the button while the textboxes are empty, I don't see any error messages
from the validators. I noticed the __doPostBack function is also missing
along with the two args in the source.

I thought a button adds this function. When I changed a textbox to
autopostback, the function appeared. But I don't want to autopostback and
the error messages still don't show up.

I have display set to dynamic, enabled is true and enableclientscript is
true.
Any clues?

J.

Nov 18 '05 #3

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

Similar topics

6
by: BK | last post by:
I'm having a really strange problem with and HtmlSelect server control (listbox) and a RequiredFieldValidator that I am trying to use to make sure that someone has items in the listbox. The way...
3
by: Steve Yerkes | last post by:
There seems to be way too much confusion over how to set focus on the a field using a field validator. I looked all over the web and found people trying to do this, but not getting anywhere. There...
3
by: me | last post by:
Is there any particular reason why a requiredfieldvalidator cant validate a listbox? I have bound the two together but the validator always returns false on isvalid and so does the Page, no matter...
7
by: Ed West | last post by:
Hello, I have a simple form with some input boxes. After validation if one fails, then I would like to at the top of the page say something like "The following fields in red are required" and...
4
by: James | last post by:
Hello, I have a RequiredFieldValidator for several textbox controls on a form. Here's an example with the RequiredFieldValidator. EnableClientScript, Enabled, and Visible are set to true for...
4
by: Joe | last post by:
Hello, I have created a login page using dotnet. I am using requiredFieldValidator and noticed that the code works fine in IE but not in Netscape, Opera, Mozilla, Firefox, etc. For example...
5
by: Christian Ista | last post by:
Hello, I have a form with 5 textbox for each one a RequiredFieldValidator I show (*) if the field is missing when I post the form. I'd like when a least one of theses RequiredFieldValidator...
5
by: Fernando Lopes | last post by:
Hi. I want to show an image in a requiredfield validator instead of "*". So, I 'm set the requiredfieldvalidator attributes like following: <asp:RequiredFieldValidator id=rfvFirstName...
11
by: Alan Silver | last post by:
Hello, I am using this validator on a textbox, and have discovered that if I set the InitialValue property, then the validator correctly fires if the user does not change the initial value of...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
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.