473,386 Members | 1,793 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.

Required Field Validator Does Not Block Postback

Wow, this is a really embarassing thing to have to ask about...

I have an asp.net page with a multiview control in it. We want to enter
person info in a semi - wizard style and I wanted to use required field
validators for, well required fields. On the first view, the person
enters first name, last name and a couple other things. the RFV works
great on first and last name and we move on to the next view -
Addresses. I want to be able to enter multiple addresses so I have an
update button that stores each address entered into a private variable
and clears the form for the next address (yes, it is set to
CauseValidation). The problem is the update button IS NOT causing
client side validation? WTF???

I thought this may be due to the views but I created a quick test
mockup with a MultiView, two views each with a button, a text field and
a RFV. It works every time.
Field and Validator:
<tr>
<th align="left" nowrap="nowrap">
Address One:
</th>
<td width="90%" align="left">
<asp:TextBox ID="txtAddressLineOne" runat="server"
MaxLength="100" Width="250px"></asp:TextBox>&nbsp;
<asp:RequiredFieldValidator id="rfvAddressLineOne"
runat="server" ErrorMessage="Address 1 is a
Required Field" ControlToValidate="txtAddressLineOne"
CssClass="ErrorMessage"
EnableClientScript="true">
*Required
</asp:RequiredFieldValidator>

</td>
</tr>
Button:

<asp:Button ID="btnUpdate" runat="server" Text="Update"
OnClick="btnUpdate_Click" CausesValidation="true"/>

Any ideas?

Dinsdale

Sep 22 '06 #1
0 1960

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

Similar topics

3
by: Rick | last post by:
I have an interesting problem when I run the following code in Netscape (7.02) vs. IE. This page works great in IE and all my controls bring up the validation summary dialog box if the required...
5
by: Do | last post by:
Hi, Has anybody run into problems with Page.IsValid? My errors show up when the fields aren't filled correctly, but my processing continues even if the page is invalid. I leave name and...
5
by: Brent Burkart | last post by:
I have a page with a couple of Required Field Validators. However, I have a button which displays a popup with some information. I want this button to be able to work without having the Required...
4
by: Milan | last post by:
Hi, I am having a problem with displaying a * to a required field. There seems to be a problem with this and the static value does not appear unless you submit the page. I am trying to display...
2
by: pmud | last post by:
Hi, I have an ASP.Net web page . The page was working fine until I added a required field field validator. My page has a link button which takes the user to another page, a submit button which...
3
by: Kivak Wolf | last post by:
Hi, Could someone give me a quick review of how to use the required field Validator? I'm completely at a loss, and MSDN does not help one bit. =/ Basically all I want done is to make sure that...
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...
1
by: spidur1 | last post by:
For some reason these fields are not being validated before the postback. Here the HTML page. Am I missing something from the validator controls that needs to be set? <table cellpadding="0"...
0
by: nimeshdotnet | last post by:
Hi All, I have a textbox whose readonly property is set to true. This textbox is also guarded by a required field validator. What i m doing that I have a calendar control whose on date selection i...
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...
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
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...

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.