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

Strange Behavior from RequiredFieldValidator (and Two LinkButtons)

JJ
We have an ASP.NET web form with 1 TextBox, 2 LinkButtons, and 1
RequireFieldValidator. The situation is: the user needs to enter a folder
name in the TextBox and click the first LinkButton (the Create Folder
LinkButton) to create the folder. Then once that's done, they need to click
the second LinkButton (the Next LinkButton) to go to the next page (a
rudimentary wizard).

The RequiredFieldValidator is there to make sure the user enters a folder
name in the TextBox before clicking the first LinkButton (the Create Folder
LinkButton). This all works fine.

What's strange is if the user doesn't enter anything in the TextBox and
clicks the second LinkButton (the Next LinkButton) before clicking the first
LinkButton (the Create Folder LinkButton), the RequiredFieldValidator alarms
the error anyway.

Is this correct behavior? What we want is for the first LinkButton (the
Create Report LinkButton) only to validate that text has been entered in the
TextBox, not the second LinkButton (the Next LinkButton). How can we do
this?
Nov 19 '05 #1
1 1592
Hi JJ,

The function of the requiredfield validator is just to check the txtbox is
having some value or not.

If you want that checking has to be made only for the first link button and
not for the second link button, then specifically you have to inform the
validator as follows.

1. Click the second link button and go to the properties window.

2. Set the cause validation property to False.

So, here after when you are click second link button form will not do any
validations.

Hope this helps you.

Cheers,

Jerome. M
"JJ" wrote:
We have an ASP.NET web form with 1 TextBox, 2 LinkButtons, and 1
RequireFieldValidator. The situation is: the user needs to enter a folder
name in the TextBox and click the first LinkButton (the Create Folder
LinkButton) to create the folder. Then once that's done, they need to click
the second LinkButton (the Next LinkButton) to go to the next page (a
rudimentary wizard).

The RequiredFieldValidator is there to make sure the user enters a folder
name in the TextBox before clicking the first LinkButton (the Create Folder
LinkButton). This all works fine.

What's strange is if the user doesn't enter anything in the TextBox and
clicks the second LinkButton (the Next LinkButton) before clicking the first
LinkButton (the Create Folder LinkButton), the RequiredFieldValidator alarms
the error anyway.

Is this correct behavior? What we want is for the first LinkButton (the
Create Report LinkButton) only to validate that text has been entered in the
TextBox, not the second LinkButton (the Next LinkButton). How can we do
this?

Nov 19 '05 #2

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

Similar topics

3
by: Navin | last post by:
Hello friends... On a single asp.net web page i have a single server-side form that contains a couple of user-controls. Each user control has its own functionality and contains server-side textbox...
0
by: Nicolas | last post by:
How can I have only one RequiredFieldValidator to control two TextBox webcontrols so that only one message is displayed <asp:Label id="lbl_UserName" runat="server"></asp:Label><br> <asp:TextBox...
3
by: RSB | last post by:
Hi every one , i am creating this form and i have two asp:Linkbuttons one for save and one for Cancel. Now i also have some RequiredFieldValidators on this Form and i only want to Execute...
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...
2
by: Jouni Karppinen | last post by:
Hi I have a problem with RequiredFieldValidators that are working differently in Windows XP SP2 and Windows 2000 Server. I have a web form with 2 textboxes with 2 RequiredFieldValidators. ...
4
by: needin4mation | last post by:
I added this to my javascript: if (chkActive.checked==true) { ValidatorEnable(frval_DdlInactive, false); ValidatorEnable(val_datIntacive,false); } If my checkbox is true I want to turn...
2
by: COHENMARVIN | last post by:
I have a form with a Submit button. The user fills out the form, clicks the submit button, and then the page posts back to itself. Every time the page posts back to itself, the "Page_Load" event...
7
by: Tim_Mac | last post by:
hi, using .net 2.0, i have a web form with lots of textboxes, drop-down-lists etc. There are lots of required field validators and regular expression validators. When i click the 'save' button,...
2
by: sirdavethebrave | last post by:
Hi guys - I have written a form, and a stored procedure to update the said form. It really is as simple as that. A user can go into the form, update some fields and hit the update button to...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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: 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...

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.