Re: Creating a validationsummary

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Chris Jackson (chrisjATmvpsDOTorgNOSPAM)
Date: 02/13/04


Date: Fri, 13 Feb 2004 11:11:14 -0500

I have not undertaken this particular task, though I have called the
validation scripts by hand on several occasions. So, thinking about the
problem, there are a couple of different approaches that I can think of.

First, you could step through the client side validation scripts, and see
what methods are doing the tasks that you want. You can then build your own
script that calls into these scripts where you want to use their
functionality, but then handles the display when you want to have control.

Alternately, you know that there is an option to have these messages display
on the page instead of popping up a message box. You could use
Attributes.Add to attach an onchange event handler when the script updates
these controls, and then use the text in here to create your own popup
window.

-- 
Chris Jackson
Software Engineer
Microsoft MVP - Windows Client
Windows XP Associate Expert
-- 
More people read the newsgroups than read my email.
Reply to the newsgroup for a faster response.
(Control-G using Outlook Express)
-- 
"Christer" <winterdk@hotmail.com> wrote in message 
news:7beadfe3.0402121206.660d27b3@posting.google.com...
> Hi all!
>
> I recently created a MessageBox webcontrol for asp.net. This can be
> used as is, but I also want to take ude of it in other webcontrols.
> Right now i creating a ValidationSummary control, that makes use of my
> messagebox to show the summary of failing validators.
>
> So far I've been successfull achieving this. However, the serverside
> nature of the MessageBox currently forces all validators (and the
> validationsummary) to have EnableClientScript=false. In short this
> means that all validations are made on the server, which causes
> postbacks.
>
> The validationsummary webcontrol shipped with the .net framework makes
> it possible to have the validationsummary displayed in a javascript
> alert-messagebox. I want to recreate the same clientside display with
> my own messagebox. In short, write the messagebox to the page in a
> hidden state, and show it on demand.
> However, the .net valisationsummary alert is created in the included
> validation-javascript file (WebUIValidation.js) wich also contains all
> the functions for clientside validation so, as I see it, it's quite
> impossible to both have clientsidescript enabled on validationcontrols
> and summary, and still create my own clientside daisplay of the
> failing validator.
>
> Does any of you out there been in similar situations? Any ideas how to
> cut my cake? I'm determined to use the existing clientside
> functionality with regards to validation, by I'd like to make my own
> display function.
>
> Kind regards
> Christer 


Relevant Pages

  • Re: validation summary not always showing message box
    ... Microsoft Online Support ... |> As for the dynamic added validtor not fire messageBox problem, ... Actually the validation summary's messageBox is ... |> clientside before we submit the page....), that's why you only see other ...
    (microsoft.public.dotnet.framework.aspnet.webcontrols)
  • Re: Forms
    ... dorayme pronounced to ... > add some client-side validation so they get feedback before submitting ... > scripts available in whatever language you prefer - many already set up ... js I can scrounge up for quick feedback. ...
    (alt.html)
  • Re: Forms
    ... > that have required fields and that pick up user mistakes quickly for the ... the form *must* be validated server-side. ... add some client-side validation so they get feedback before submitting ... scripts available in whatever language you prefer - many already set up ...
    (alt.html)
  • Re: Using vbBinaryCompare
    ... > binary values in the registry. ... > this validation process because my scripts always crashes. ... ' If a value is present but uninitialized the RegRead method ...
    (microsoft.public.scripting.vbscript)
  • Re: Validate form input (ASP)
    ... It sounds like you're using FrontPage to create your validation script, ... WebBot to create the JavaScript that does the validation. ... Kindly do let me know where should I put those scripts in the code ...
    (microsoft.public.frontpage.programming)