- This topic is empty.
-
AuthorPosts
-
December 5, 2012 at 1:32 pm #41179M_a_r_cMember
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,
MarcDecember 5, 2012 at 9:37 pm #116469SgtLegendMemberWhy not just use the standard reset method that all browsers have built into them?
function resetform() {
formid.get(0).reset();
emailsend = false;
}December 6, 2012 at 10:19 am #116522M_a_r_cMemberHi,
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
MarcDecember 8, 2012 at 8:11 pm #116586SgtLegendMember> 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();
}December 9, 2012 at 5:27 pm #116622M_a_r_cMember[ironie on]IE rulez[ironie off]
You’re right it really works even if its ugly…Thank you
December 10, 2012 at 6:36 am #116734Paulie_DMember>[ironie on]IE rulez[ironie off]
Spellcheck off too…apparently. :_
December 15, 2012 at 1:41 am #117503M_a_r_cMemberYeah sorry this happend if you think german and writen english :(
-
AuthorPosts
- The forum ‘Other’ is closed to new topics and replies.