nanatiris / jquery-watermark

Automatically exported from code.google.com/p/jquery-watermark
0 stars 0 forks source link

on submit, hide watermarks only in the form being submitted? #24

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Just a suggestion regarding how watermark handles hiding watermarks on form 
submission - 
instead of hiding ALL watermarks on the current page when a form is submitted, 
only hide those 
watermarks within the form being submitted.

I have a page with multiple forms containing watermarks, and currently the 
other forms all "blink" 
every time one form on the page is submitted (the forms submit via ajax so it's 
particularly 
noticeable when the page is not reloading).

What do you think?

Original issue reported on code.google.com by reganyel...@gmail.com on 18 May 2010 at 3:48

GoogleCodeExporter commented 9 years ago
I like it, thanks for the feedback.   I'm going to accept the issue, and keep 
it here until added.  Also, it's been changed to "Enhancement", because the 
current behavior is by design.

Original comment by t...@speednet.biz on 22 Jun 2010 at 2:36

GoogleCodeExporter commented 9 years ago
Thanks for a great plugin, but I also had the same issue when submitting AJAX 
forms that use the watermarks.

My fix,

created a new "hideCurrent" method on $.watermark that does almost the same as 
hideAll except it scopes the hide selector to "this":

hideCurrent: function () {
    if (pageDirty) {
        $.watermark.hide($(selWatermarkAble, this));
        pageDirty = false;
    }
},

I then edited the code that handles the submits.

  $form.submit($.watermark.hideAll);
Becomes:
  $form.submit($.watermark.hideCurrent);

And the 2x "$.watermark.hideAll();" below I changed to 
$.watermark.hideCurrent();

Hope this helps!

Original comment by sigu...@gmail.com on 29 Oct 2010 at 1:49

GoogleCodeExporter commented 9 years ago

Original comment by t...@speednet.biz on 3 Dec 2010 at 4:14

GoogleCodeExporter commented 9 years ago
Hi I think I've got a related problem, I've got a watermark on a password input 
element. If I type the username, tab to the password box, type password and 
then press return the password is cleared and only the username gets submitted. 
If I take off the  watermark it all works fine.

I've tried what was suggested above but had not luck.

Firefox, Chrome I have tested this on so far

Original comment by mattleth...@gmail.com on 7 Jun 2011 at 5:34

GoogleCodeExporter commented 9 years ago
Did you try it with the demo page included in the download package?  It seems 
to work just fine for me using Firefox and Chrome, using the steps you 
described.

After testing the demo page (and seeing it work OK), I'd suggest you strip 
everything but the bare essentials out of your page, see that it works OK, and 
then start adding things back in until it fails.  That will tell you what the 
conflict is.

Original comment by t...@speednet.biz on 7 Jun 2011 at 5:42

GoogleCodeExporter commented 9 years ago
I have also run into this issue and would really like it fixed. I'm going to 
try the hideCurrent suggestion posted.

Original comment by br...@vallelunga.com on 26 Jul 2011 at 5:18

GoogleCodeExporter commented 9 years ago
Would be great to see this.

I have this issue on an autocomplete field. If the user selects a suggested 
option with the keyboard arrows and presses enter it triggers hideAll.

In this scenario it's really important this is resolved as the form doesn't 
submit and the problem persists while the user attempts to continue completing 
the form.

Original comment by p...@realworksmedia.com on 5 Sep 2013 at 1:53

GoogleCodeExporter commented 9 years ago
This issue is fixed in the latest release (3.2.0).

Original comment by t...@speednet.biz on 16 Aug 2014 at 4:48