Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other Html5 problem IE9

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #41179
    M_a_r_c
    Member

    Hi,
    currently I’ve a strange problem I don’t understand.

    I’ve created a HTML5 Form and for IE I’ve included a placeholder shim.
    The Form has two buttons one for submit and another one for downloading a PDF.

    I’ve created a small JQuery script which basically validates a few form fields if everything is alright it submits everything to process.php and then resets the form fields to their initial values…

    The problem starts with IE while trying to reset the form fields it does not work.
    But if you fill out all required fields and hit the download button magically the form fields resetting! That drives me nuts because that seems to be kind of a default behavior?

    I wonder how I could write a function which works in all browsers to reset the form fields to their placeholder text…

    function resetform() {
    formid.find(“input”).each(function () {
    jQuery(this).val(“”);
    })
    formid.find(“textarea”).val(“”);
    emailsend = false;
    }

    Strange in all other Browsers this works fine.

    kindest regards,
    Marc

    #116469
    SgtLegend
    Member

    Why not just use the standard reset method that all browsers have built into them?

    function resetform() {
    formid.get(0).reset();
    emailsend = false;
    }

    #116522
    M_a_r_c
    Member

    Hi,
    good question I dont remember:)
    But your code works perfectly thank you very much for this…

    There is just s small issue left in IE after the reset all fields are totally blank while other browsers showing the placeholder text instead. When I click in one of those totally blank fields in IE the placeholder text is shown again… Thats kinda ugly to me is there a way to solve this too?

    regards
    Marc

    #116586
    SgtLegend
    Member

    > There is just s small issue left in IE after the reset all fields are totally blank while other browsers showing the placeholder text instead. When I click in one of those totally blank fields in IE the placeholder text is shown again

    You could maybe use something really ugly like the following which should work.

    function resetform() {
    formid.get(0).reset();
    emailsend = false;

    $(‘input, textarea’, formid).each(function() {
    this.focus();
    });

    $(‘input:first’, formid).get(0).focus();
    }

    #116622
    M_a_r_c
    Member

    [ironie on]IE rulez[ironie off]
    You’re right it really works even if its ugly…

    Thank you

    #116734
    Paulie_D
    Member

    >[ironie on]IE rulez[ironie off]

    Spellcheck off too…apparently. :_

    #117503
    M_a_r_c
    Member

    Yeah sorry this happend if you think german and writen english :(

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘Other’ is closed to new topics and replies.