Contact Form Problem

Discussion in 'Web Design and Development' started by Grosvenor, Apr 16, 2012.

  1. Grosvenor macrumors newbie

    Joined:
    Apr 3, 2012
    #1
    HI Guys,

    I'm currently building a website that uses a 'Booking Form'. I've tested it on Macs and PCs, using various browsers and it works fine.

    The trouble begins while testing on an iPad, When submit button is pressed, even with no fields filled in, to test the client side validation. It goes to a 404 page error.

    Has anybody come across this before?

    Url: http://ledesign.co.uk/basic_framework/lessons.php

    Thanks
     
  2. Darth.Titan macrumors 68030

    Darth.Titan

    Joined:
    Oct 31, 2007
    Location:
    Austin, TX
    #2
    The form gives me no problems on my iPad.

    No 404 errors here.

    On a side note:
    Your JQuery script call
    Code:
    <script type="text/javascript">
    $(document).ready(function(){
    	$("#comment-form").validate();
    });
    </script>
    should be at the end of the file before the closing </body> tag, not in the <head>. That's just a "best practice" tip.
     
  3. Grosvenor thread starter macrumors newbie

    Joined:
    Apr 3, 2012
    #3
    Booking Form

    Thanks for the reply.

    That's interesting... I'm wondering why it didn't work on the ipad I used!
    Could it be differences with the revision models (ipad1 or ipad2)?

    Thanks also for the code position info. I'll move it before the site goes live.

    Cheers
     
  4. clemsonhomerun macrumors newbie

    Joined:
    Jul 11, 2009
    #4
    Dont listen to the part about this being a best practice... the .ready() function takes care of loading this after page load.
     
  5. Darth.Titan macrumors 68030

    Darth.Titan

    Joined:
    Oct 31, 2007
    Location:
    Austin, TX
    #5
    Be that as it may... it's still best practice.

    Good call resurrecting an old thread to spread misinformation.
     
  6. clemsonhomerun macrumors newbie

    Joined:
    Jul 11, 2009
    #6
    Dont post misinformation and it wont get brought back up. Sometimes people read old threads and no use spreading misinformation. Head or End of page, it waits until the DOM is set before it executes. Now if it had been other JS i wouldve agreed and left it alone...
     
  7. Darth.Titan macrumors 68030

    Darth.Titan

    Joined:
    Oct 31, 2007
    Location:
    Austin, TX
    #7
    JQuery is still javascript, and it is still best practice to load any javascript after the DOM. While it's true that JQuery will stall its enclosed code's execution until the page is ready, $(document).ready() itself still has to be processed, and it's best to process it after everything else is loaded.
    You're incorrect that it doesn't make any difference. Granted it's not much of a difference, but that's why I said it was best practice. If you choose not to follow best practices, your code will still probably work just fine. It will just be less correct.
    You'll notice that the complete examples in JQuery's own documentation have their scripts at the end of the file. I wonder why that is?

    I'm going to let this thread fade back into the annals of history now...
     

Share This Page