473,326 Members | 2,147 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,326 software developers and data experts.

Validator Control

Hi,

In my webform i have few text box controls and 1 button control.
and for each text box i have placed

required field validatior.
and i set the following properties of

required field validator

Control to validate = the corresponding

text box name
display=dynamic
error message=must enter value
enableclient script=true

when am running my application if i directly goes to 2 textbox control with
out entering any value in 1st textbox then it has to display the error
message

which i had specified na but it is

not displaying any error message at

that time but it is displaying error

message after clicking on submit

button.
but what i need is it has to display this message
when the control lost its focus.
or before clicking on submit button.

can anybody tell me the solution for my problem.plz its urgent.
thanx in advance
yoshitha

Nov 19 '05 #1
5 1301
Hi yoshitha
make the autopostback of textbox to true
Hope this help:)

"Yoshitha" wrote:
Hi,

In my webform i have few text box controls and 1 button control.
and for each text box i have placed

required field validatior.
and i set the following properties of

required field validator

Control to validate = the corresponding

text box name
display=dynamic
error message=must enter value
enableclient script=true

when am running my application if i directly goes to 2 textbox control with
out entering any value in 1st textbox then it has to display the error
message

which i had specified na but it is

not displaying any error message at

that time but it is displaying error

message after clicking on submit

button.
but what i need is it has to display this message
when the control lost its focus.
or before clicking on submit button.

can anybody tell me the solution for my problem.plz its urgent.
thanx in advance
yoshitha

Nov 19 '05 #2

hi sara
i have set postback property of all the text boxes to true only.
tough i set am not getting the messages which i had provoded for these
controls .
am getting these messages after clicking submit button only but i want
todispay before clicking on submit button
Nov 19 '05 #3
to do this u must chang the property of enable validation to true but on
textbox i dont know how
"Yoshitha" wrote:

hi sara
i have set postback property of all the text boxes to true only.
tough i set am not getting the messages which i had provoded for these
controls .
am getting these messages after clicking submit button only but i want
todispay before clicking on submit button

Nov 19 '05 #4
set textbox autopostback property to true and add the following code to the
page_load event:

if ( Page.IsPostBack )
{
Page.Validate();
}

Hth. Kind regards,
Nikander & Margriet Bruggeman

"sara" wrote:
to do this u must chang the property of enable validation to true but on
textbox i dont know how
"Yoshitha" wrote:

hi sara
i have set postback property of all the text boxes to true only.
tough i set am not getting the messages which i had provoded for these
controls .
am getting these messages after clicking submit button only but i want
todispay before clicking on submit button

Nov 19 '05 #5
I set post back property true for all the text boxes.and for each text box i
also placed required field validator control.

so when i run my application if i enter any data in the first text box then
am getting the messages for remaining text boxes which i had set for
required field validator control.
why am getting all those messages before entering the data in remaining
text boxes?

can u tell how to solve this problem
thanx in advance
yoshitha
Nov 19 '05 #6

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

Similar topics

0
by: Tom Pearson | last post by:
I create controls and validators dynamically dependent on data at runtime. I create the control then the relevant validator(s) for it assigning the Control.ID as the control to validate. These...
8
by: Dmitry Korolyov | last post by:
ASP.NET app using c# and framework version 1.1.4322.573 on a IIS 6.0 web server. A single-line asp:textbox control and regexp validator attached to it. ^\d+$ expression does match an empty...
0
by: Bryce Budd | last post by:
Hello All, I've been a taker of information from newsgroups for a long time and thought I'd finally make a contribution back to the community whose supported me when I've needed it. After all...
2
by: Pham Nguyen | last post by:
Has anyone seen an example of a textbox server control that has built-in client-side validation? I'd like to build a server control that extends the System.Web.UI.WebControls.TextBox class to allow...
2
by: Dune | last post by:
Hi there, If a control is disabled (enabled = false), will the validator controls associated with it automatically know not to carry out validation? I have a page with a bunch of controls and...
3
by: Angelos Karantzalis | last post by:
Hi guys, I've a small problem with validators. I'm building a single .aspx file that handles all my form posts. I need to be using ASP.NET validators ( or subclasses thereof ), so what i do to...
3
by: thomson | last post by:
Hi, I have 5 aspx pages, In one page i have a Compare Validator Control, The four aspx pages are loading fast with similar controls, no code behind, But the page having Compare Validator Control...
2
by: Mike Collins | last post by:
I have a form where I create dynamic controls at runtime. With this, I am adding a dynamic required field validator to each control as needed, but the validators are not firing when I click submit....
0
by: Gonza | last post by:
Hi group, i'm trying to add a customvalidator control to a custom web control. The problem is i'm getting a "Unable to find control id..." exception. Here is the code: public class CuitTextBox :...
1
by: Gonza | last post by:
Hi group, i'm trying to add a customvalidator control to a custom web control. The problem is i'm getting a "Unable to find control id..." exception. Here is the code: public class CuitTextBox :...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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...

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.