Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

VS.net validation in firefox

Options
  • 02-11-2005 9:21pm
    #1
    Registered Users Posts: 872 ✭✭✭


    Hi,

    I have started building alot of forms in visual studio because of the cool field validation you can use (i.e. required fields, correct emails etc.) . I only realised a while ago that they dont work in firefox (and probably every other browser except for IE).

    Does anyone know of a SIMPLE way to get it to work in firefox? I have seen a few bits on the web but nothing very comprehensive.

    Thanks


Comments

  • Moderators, Science, Health & Environment Moderators Posts: 8,960 Mod ✭✭✭✭mewso


    If you do a If page.isvalid check in your .net code then you can validate on the server side instead of the client. Asp.Net just doesn't render any javascript code if it's a browser it doesn't know. If you do the check on your own code then the validation will work fine in any browser but without and fancy client side magic. Other options:-

    1. Override the rendering of the page to replace/correct the javascript that the validation controls emit.
    2. Create a new custom validation control where you can decide the correct javascript to output.
    3. Create a custom validation control and inherit from the validation control whose behaviour you wish to change and then override the rendering.

    Or you could change to Asp.Net 2 whcih I'm fairly sure only emits proper valid javascript.


Advertisement