SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Oct 2008
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Javascript not working in IE7

    If i have only one feild in my form and a submit button, and some javascript is applied to validate that feild, now if i click the submit button, javascript works fine but if i enter some value in feild and press enter key then the javascript is not executed and the form is submitted without javascript validation. this issue is only in IE, and not in any other browser.


    anybody have idea, why it is doing so????

    Thanks,
    Faisal Amir Awan.

  2. #2
    SitePoint Member
    Join Date
    May 2008
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It would be good if you showed us some code. Are you stopping the submit event?

  3. #3
    Function Curry'er JimmyP's Avatar
    Join Date
    Aug 2007
    Location
    Brighton, UK
    Posts
    2,006
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is probably happening because you've attached the validation to the onclick event of the submit button. It's best practice to attach it to the onsubmit event of the form instead.
    James Padolsey
    末末末末末末末末末末末末末末末末末末末
    Awesome JavaScript Zoomer (demo here)
    'Ajaxy' - Ajax integration solution (demo here)


Tags for this Thread

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
  •