I've added validator error messages for some of my custom fields which display on the Product page. When the product information (description, etc) is long, you don't see the validation message unless you scroll down. I'd like the error message to be more visible by having the page scroll down to it.
I've done this in a different project by adding an internal page link and appending the internal page link to the querystring. Has anyone done something like this already?
Alternatively, is there a way to display an AJAX modal popup window stating there are errors and the user may need to scroll down to see them?
Thanks.
Has anyone added code to scroll to validation messages?
Re: Has anyone added code to scroll to validation messages?
ASP.NET page also contains a client side flag about the validity of page called Page_IsValid. Read following topic about details
http://msdn.microsoft.com/en-us/library/aa479045.aspx
You can wrap your ValidationSummary in a div with some anchor and then put some javascript upon some suitable location to jump to that anchor location depending upon this flag.
http://msdn.microsoft.com/en-us/library/aa479045.aspx
You can wrap your ValidationSummary in a div with some anchor and then put some javascript upon some suitable location to jump to that anchor location depending upon this flag.
Re: Has anyone added code to scroll to validation messages?
Thanks Mazhar. I wasn't aware of the client side flag. I can just add a client side script block at the bottom of the page that looks for that flag and the div. If both are present, redirect to it.
Separate from that, I'll be posting my validation code sometime today. I've got slightly improved version of the required field validation customization to show. But more importantly, I have a regular expression validation customization to show.
Regards,
ZLA
Separate from that, I'll be posting my validation code sometime today. I've got slightly improved version of the required field validation customization to show. But more importantly, I have a regular expression validation customization to show.
Regards,
ZLA