homepage Welcome to WebmasterWorld Guest from 23.20.34.25
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor
Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
Forum Library, Charter, Moderators: ocean10000

Microsoft IIS Web Server and ASP.NET Forum

    
ASP.Net Field Validation
Want it done client side
RossWal




msg:945253
 10:19 pm on Aug 14, 2002 (gmt 0)

I'm just getting started learning asp.net. One of the first things I've noticed is that some of the cool stuff it does happens server side rather than client side. Like if you disable a control in an on-click event, or when you use the required field editing control. Though I'm a ways away from doing this, I'm wondering if it would be feasible to write a custom control that would write some javascript to the client for field editing. The trick would be tying that code to the change (or whatever) event on the control to be edited.

Has anyone done any thinking on this? Are there any good 3rd party controls I should look at?

Thanks for any input.

PS It apears this board tends to be somewhat advanced and doesn't have a ton of traffic. Having said that it would seem that a bunch of newbie questions could quickly become somewhat of an annoyance. Is there a more appropriate forum elsewhere for someone trying to teach themselves asp.net?

Thanks again!

 

Xoc




msg:945254
 9:22 am on Aug 15, 2002 (gmt 0)

Newbie questions are very, very welcome here! Ask away.

There actually already are some custom controls for doing field level validation. They do client-side validation if the client has javascript turned on, but also always do server-side validation, so there is no way to bypass the validation by browser settings or hacking. They are really cool. I haven't really played with them except demo code, but take a look at the Required Field Validator, Compare Validator, Range Validator, Regular Expression Validator, and Custom Validator controls.

RossWal




msg:945255
 4:15 pm on Aug 15, 2002 (gmt 0)

Thanks Xoc. I don't know what I was thinking.... I though sure I had checked and there was no client side validation on the required field edit. I rechecked, and sure enough it's there. Must have been dreaming....back to sleep time ;)

andrey_sea




msg:945256
 4:52 pm on Aug 15, 2002 (gmt 0)

Greg,

I am using Required Field Validator and Range Validator controls, but the way they work is they do a javascript document.write() thing to generate text on the page before posting back to the server. The question is where do you place these controls so that user doesn't become confused? See my form is rather long and it must be that way. So there is some vertical scrolling, so if I put a validation control next to the field at the top user will not see that there is a problem and will keep hitting submit button to no avail. If I place all of the error messages near submit button the users will get irritated about scrolling up. What would you do? Is there a way to make these web form controls pop up error message boxes of the alert() type?

Thanks!

andrey_sea




msg:945257
 7:48 pm on Aug 15, 2002 (gmt 0)

Never mind my previous post, I have this problem solved using * in Text property and error text in ErrorMessage property of validation controls. Combined with validationsummary control it works great!

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Microsoft / Microsoft IIS Web Server and ASP.NET
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved