PDA

Click to See Complete Forum and Search --> : Button enabling during validation


sevenhalo
Jan 3rd, 2006, 09:05 AM
(This question is a combination of ASP.Net (VS 2003) and javascript. The code in question is mostly javacript.)

If I'm not clear initially, please let me know. This is a little beyond me, and I'm having trouble trying to firgure out where to start.

What I have is a webform that I created using ASP.Net. I added a couple RegularExpressionValidators to the page that validate dates in textboxes (handled client-side). There's also a couple RequiredField controls as well (handled server side). I have strict server side data validation as well, but I'm trying to keep that more towards defensive programming. Also, I like the cosmetic look of client-side validation.

Back on track, what I really want to do is this. If the page isn't validated client-side (which is just the RegEx validation controls); I want to disable buttons client-side.

I have a feeling this is pretty basic JavaScript. I am able to read and follow JS, but I don't have any experience writing it. I'm not asking for code though, this is something I need to learn if I'm going to make webforms. All I'm asking for is a good, related article or tutorial that might assist me. Half my problem is that I don't know what to look for since I really haven't spent enough time with scripting.


Thanks! :wave:

Note: I italicized the main points since I have a tendency to ramble.

sevenhalo
Jan 3rd, 2006, 09:17 AM
I figured out a way to do this in ASP.Net. It turns out that since I'm handling the required fields manually, the RegEx controls that are enabledCLientSide can be controled by Page.IsValid and the RequiredFields are ignored until I manually check them.

I still would like a good article or tutorial to know how this is all happening client-side. I always get uneasy when something "accidently" works. :lol: