DOMValidators and Firefox

Sometime ago, I released a set of free set of controls called the DOMValidators ( available here that are a set of client side validation controls that basically mimic the validators that come with Visual Studio.NET 2003 except that they work in many other browsers apart from just Internet Explorer.

At least once a week, I get an email from somebody asking why they do not work in Firefox. The reason is that they were developed prior to the release of Firefox. In order for Firefox to be recongised as an uplevel browser (which causes the appropriate Javascript to be generated for client side operation), an entry must be added to the web.config <browsercaps> section. This is shown below so that you can copy and pase it in.

<case match="^Mozilla/5\.0 \([^)]*\) (Gecko/[-\d]+)(?'VendorProductToken' (?'type'[^/\d]*)([\d]*)/(?'version'(?'major'\d+)(?'minor'\.\d+)(?'letters'\w*)))?">

                                        <case match="(Gecko/[-\d]+)(?'VendorProductToken' (?'type'[^/\d]*)([\d]*)/(?'version'(?'major'\d+)(?'minor'\.\d+)(?'letters'\w*)))">
                                        <case> <!-- plain Mozilla if no VendorProductToken found -->
                                <case match="rv:(?'version'(?'major'\d+)(?'minor'\.\d+)(?'letters'\w*))">
                                        <case match="^b" with="${letters}">
This set of changes was actually submitted by a user of the DOMValidators who provided some feedback to me (in this case Tim Conama but there have been many others). I have to say that some of the users have been really helpfull in providing feedback and fixes to various bugs so to those who have done this, a big thank you.
Your probably thinking, "Why dont you just update the controls to include this?". Well I could, but a) I am lazy and b) these controls have been superseded by what is available in VS2005 so I dont really want to put much effort into these. There are a number of other issues that need to be resolved with the validators, and if I start modfying them, I'll get carried away and spend way too much time on them. A lame excuse? Yeah it is, but I have been called a lot worse things than lame before . . .


  • You are lame Glavich


    Hope you're doing well and your book is coming along.

    Keep in touch


  • How about Opera - I tried but it's not working!

  • In Firefox, it still does not work. I followed all the instructions on readme.txt. I am using .Net framework1.1 and as instructed, I have uncomment one line in web.config file comment the line for .Net 1.0.

    I have one textbox, one button and 2 Domvalidators on 1 webForm1.aspx: DomRequiredFieldValidator and RangeValidator.

    If textbox does not fill with anything and then I click on the button, it execute code in the button_click event and then gave the error message saying "Text is required". It supposed to not execute the code in the button_click event and gave the message "Text is required".

    What could be wrong?

    Sure the same code works fine with IE 6



  • Thanks for the fix. I was almost about to give up on this.

  • it doesn;t work on Opera(MAC), do you know if this is already solved?

Comments have been disabled for this content.