Sunday, March 11, 2012

Validator control

Why not use a single textbox instead of the 3 and validate using a datevalidator as well as a required field validator. Now you're only leftwith 2 validators. Does this work for you?

The only reason I wanted to use 3 is so the user doesn't have to enter the /'s makes certain that its entered in the correct format. Maybe I could use a script which simply adds the forward slash's after 8 chars is reached....

Thanks for your post


The existing validators do not handle the case you've described - three separate textboxes. You can use the CustomValidator to assemble the parts into a date and then validate it. It gets challenging to write on the client-side. I know because my commercial product,Peter's Date Package, includes this code to handle its DateTextBox. I encourage you to look at my solution (it's inexpensive) because it automatically inserts the missing separator characters. (It also inserts the missing year or month, with a variety of fuzzy logic rules and reformats to show the date as the user tabs off.) You can see a bunch of demos on ithere.
hello
you can use a calendar popup component at the Following link:
http://www.eworldui.net/
so you can download it and use it for free
anytime.
Hi,
Try to validate at server side. Then you can validate all three controls at a time.

Only the CustomValidator can be setup to evaluate multiple textboxes as one element because you write the code to make it do that. The CompareValidator and RangeValidator only look at a single textbox.
Yes, By using Custom Validator , you can evaluate multiple textboxes at a time. I did it like that only.
Would you mind pointing me in the right direction to achieve this with a customer validator?
Thanks to everyone for your posts...
You could set the causesValidation property to false and then call theisvalid property of the validators loop through them and then finallyget the values, in case if it gets tedious for you you could make asmall function and implement it and then call it whenever a button isclicked or at the page_load event.

No comments:

Post a Comment