Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Grosvenor

macrumors newbie
Original poster
Apr 3, 2012
4
0
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
 
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.
 
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
 
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.

Dont listen to the part about this being a best practice... the .ready() function takes care of loading this after page load.
 
Be that as it may... it's still best practice.

Good call resurrecting an old thread to spread misinformation.

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...
 
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...

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...
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.