SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot
    Join Date
    Feb 2011
    Location
    The land of nod
    Posts
    153
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    IE8 and below - Javascript not working... ?

    Hi all,

    Im just testing a site Ive built online (BETA Verison currently) and I cannot get either of my forms Javascript to kick in when trying to submit the form with empty fields, works fine across all modern browsers, Im just wondering if I should have a <no script> tag in telling the user they need Javascript activated in order for the page to work correctly.
    Otherwise I can turn off/remove the Javascript but then Im relying on the server side validation to kick in, which is the incorrect way of going about it, as its an unneccessary work load for the server to cope with.

    Any thoughts/comments would be well appreciated

    Javascript in form will not work in IE 8 or below.

    Also just found that the title attribute doesnt seen to be working in IE 8 and below aswell, I have tried moving the attribute from in 1 example the <a> tag to the <li> tag, but that change didnt work either...

    Domain is : www.news-ball.co.uk/test (then either of the 2 forms: order an epc or contact)

    Thanks

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,696
    Mentioned
    101 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by benisjamin View Post
    I cannot get either of my forms Javascript to kick in when trying to submit the form with empty fields, works fine across all modern browsers
    When I remove the maps on the contact page, the form then behaves correctly in IE8, so there's something about the map there causing the problem.

    Quote Originally Posted by benisjamin View Post
    Im just wondering if I should have a <no script> tag in telling the user they need Javascript activated in order for the page to work correctly.
    No you should not do that, for you are then just giving up.

    Quote Originally Posted by benisjamin View Post
    Otherwise I can turn off/remove the Javascript but then Im relying on the server side validation to kick in, which is the incorrect way of going about it
    You are completely wrong there. Server validation is and should always be the first line defense. Using JavaScript to enhance the user experience by cathing problems before the form is submitted is well and good, but reliance on JavaScript for validation will only lead to sorrow.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    SitePoint Zealot
    Join Date
    Feb 2011
    Location
    The land of nod
    Posts
    153
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Paul,

    Ive just commented out the map as seen below, and yes the page is not looking pretty, but the Javascript is still not working when I click the submit button when all input fields are empty. I take it from your comment saying you managed to achieve the form being sent once the map was removed, have I obviously done something wrong with my commenting out ?

    Code:
    <!--<div id="map">
    			<iframe width="300" height="325" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.co.uk/maps?f=q&amp;source=s_q&amp;hl=en&amp;geocode=&amp;q=384+Wood+End+Road+WV11+1YD&amp;aq=0&amp;sll=52.561383,-1.950863&amp;sspn=0.247948,0.837021&amp;vpsrc=0&amp;ie=UTF8&amp;hq=&amp;hnear=384+Wood+End+Rd,+Wolverhampton,+West+Midlands+WV11+1YD,+United+Kingdom&amp;t=m&amp;ll=52.614045,-2.0856&amp;spn=0.016937,0.025749&amp;z=14&amp;output=embed"></iframe><br /><small><a href="http://maps.google.co.uk/maps?f=q&amp;source=embed&amp;hl=en&amp;geocode=&amp;q=384+Wood+End+Road+WV11+1YD&amp;aq=0&amp;sll=52.561383,-1.950863&amp;sspn=0.247948,0.837021&amp;vpsrc=0&amp;ie=UTF8&amp;hq=&amp;hnear=384+Wood+End+Rd,+Wolverhampton,+West+Midlands+WV11+1YD,+United+Kingdom&amp;t=m&amp;ll=52.614045,-2.0856&amp;spn=0.016937,0.025749&amp;z=14" target="_blank">View Larger Map</a></small>
    		</div>-->
    Last edited by benisjamin; Oct 5, 2011 at 04:10. Reason: spelling


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
  •