Results 1 to 5 of 5

Thread: Form validation (required fields) only working in firefox and not in IE or Safari

  1. #1
    Join Date
    Sep 2012
    Posts
    15
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Form validation (required fields) only working in firefox and not in IE or Safari

    I was wondering if anyone could help? This isn't using a DD script but instead originated as a basic form from wufoo. From there I copied the code and built on that, adjusted the css accordingly etc.

    It submits to email with no problems, that part is fine. However there are around 9 required fields, in firefox if any of these are left blank the form doesn't submit and the required fields are highlighted (doesn't look the best but will look at that afterwards) however in IE or Safari it doesn't validate at all and just submits to the 'thanks for contacting us' message. I can leave the form completely blank and it goes through ok in these browsers!

    Have googled it and people have similar issues but not the same so can't find an answer. In those cases it seems to be quite an easy fix with an adjustment to the script.

    any help would be appreciated, it's my own fault for trying to take shortcuts!

    EDIT: It validates as normal on chrome too.
    Last edited by magnetik12; 03-25-2013 at 05:18 PM.

  2. #2
    Join Date
    Dec 2008
    Location
    Portsmouth, UK
    Posts
    1,815
    Thanks
    2
    Thanked 424 Times in 418 Posts

    Default

    please post a link to your page
    Vic
    God Loves You and will never love you less.
    http://www.vicsjavascripts.org/Home.htm
    If my post has been useful please donate to http://www.operationsmile.org.uk/

  3. #3
    Join Date
    Sep 2012
    Posts
    15
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Oh sorry, I meant to do that! http://www.paycoservices.co.uk/SU_reg2.asp#.UVB4vaWduS0

    Thanks

  4. #4
    Join Date
    Sep 2012
    Posts
    15
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    I think this may be better in the asp forum as it is a site built using .asp.

    Shall I re-post in there or can someone move it?

  5. #5
    Join Date
    Apr 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    try this code probably it will be helpful to you

    <xhtmlConformance mode="Legacy"/>
    set in your web.config, then client-side validation is disabled in firefox.

    To see why, we have to jump down into the validation framework that ASP.Net sends to the web browser. The actual Javascript validation function looks like:

    Code:
    function ValidatorValidate(val) {
          val.isvalid = true;
          if (val.enabled != false) {
                if (typeof(val.evaluationfunction) == "function") {
                      val.isvalid = val.evaluationfunction(val);
                }
          }
          ValidatorUpdateDisplay(val);
    }
    This produces a block of Javascript just before the closing </form> tag like:

    Code:
    <script type="text/javascript">
    <!--
    var TextBox1 = document.all ? document.all["TextBox1"] : document.getElementById("TextBox1");
    TextBox1.value = "";
    // -->
    </script>
    Last edited by james438; 04-24-2013 at 04:29 PM. Reason: removed illegal signature

Similar Threads

  1. Required fields in php email form
    By xur82 in forum PHP
    Replies: 1
    Last Post: 05-29-2012, 03:45 PM
  2. Form required fields
    By Didier in forum Dynamic Drive scripts help
    Replies: 0
    Last Post: 12-19-2008, 11:06 AM
  3. Required Fields validation
    By izzysanime in forum Dynamic Drive scripts help
    Replies: 6
    Last Post: 06-05-2007, 03:47 AM
  4. Replies: 0
    Last Post: 05-08-2007, 09:12 PM
  5. Contact Form W Required Fields
    By miradoro in forum PHP
    Replies: 1
    Last Post: 12-11-2005, 09:29 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •