loisoft / jquery-watermark

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

Enhancement request - optionally leave some watermarks visible on form submit #48

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.
2.
3.

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?

Please provide any additional information below.

Currently the plugin hides the watermark on all watermarked elements when the 
form is submitted. It would be useful to have it not do this for some elements.

For example, I use the jQuery UI Autocomplete widget in Combobox mode. Using 
this widget takes a <select> element that you provide, hides it, and inserts a 
textbox (which I then apply the watermark to). When the user picks a value in 
the combobox, it selects the same value in the hidden select.

When the form is submitted, a value is posted from the hidden select but not 
from the combobox's textbox, as the widget does not give the textbox a 'name' 
attribute. Hence, there is no benefit in hiding the combobox's watermark.

One solution could be to filter for elements with a name attribute when hiding 
them during form submission. Another would be to define a new option e.g. 
hideOnSubmit which could default to true.

Original issue reported on code.google.com by GlasgowD...@gmail.com on 28 Jan 2011 at 11:47

GoogleCodeExporter commented 8 years ago
Thanks for the feedback.  Your suggestions make sense to me, I'll look into 
adding them.

Original comment by t...@speednet.biz on 5 Feb 2011 at 7:38

GoogleCodeExporter commented 8 years ago
This issue is fixed in the latest release (3.2.0). The fix is to place the 
element you wish to leave the watermark intact on outside of the form being 
submitted.

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

GoogleCodeExporter commented 8 years ago
I have some concerns with the fix as you describe it...
With the widget I described originally, the element will be inside a form. Also 
I'm generally allergic to having input elements outside of forms.
Would it not be possible to check the name attribute as originally suggested?
Thanks

Original comment by GlasgowD...@gmail.com on 16 Aug 2014 at 5:51

GoogleCodeExporter commented 8 years ago
just put it in a different form if you're allergic.

Original comment by t...@speednet.biz on 16 Aug 2014 at 5:58

GoogleCodeExporter commented 8 years ago
Which wouldn't solve the issue that led me to raise this ticket in the first 
place. It can't just be in any old form, it's part of one form that is 
receiving user input into a number of fields and which is then submitted.

Original comment by GlasgowD...@gmail.com on 16 Aug 2014 at 6:03

GoogleCodeExporter commented 8 years ago
What exactly is the value of not hiding the watermark?  Is it because you are 
using AJAX to submit, and the watermark disappears?  If so, why not 
programmatically show the watermark again after submitting?

If it's just a convenience thing, then it is too much of an edge case to make 
this kind of change, because anything that changes involving the form submit 
process can throw off many other peoples' pages.

Original comment by t...@speednet.biz on 16 Aug 2014 at 8:29