iframed form doesn't show alerts on IE

Discussion in 'JavaScript' started by datrader, Dec 11, 2012.

  1. #1
    hi,


    i have a form which onsubmit , it alerts the user with form errors.

    the form is placed inside an iframe.


    the alerts appear well on FF and chrome, but not on IE.

    how can i fix this ?
     
    datrader, Dec 11, 2012 IP
  2. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #2
    Are you getting any errors in IE? (Press F12 when there should be an alert and there isn't.)
     
    Rukbat, Dec 11, 2012 IP
  3. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #3
    That's because on IE iframes are treated as their own windows -- which means the alert is actually somewhere INSIDE that iframe, possibly scrolled out of view.

    Which is just another of the reasons one shouldn't be using iframes any time after 1997. Particularly for something where accessibility should be paramount -- LIKE ON A FORM!!!
     
    deathshadow, Dec 15, 2012 IP