TWEagle / jquery-watermark

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

Error when there's no form on the page: this.form is null #8

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create a simple HTML page with only one text input on it. 
2. Add the following script $("#myTextbox").watermark("Enter your name");
3. The following error appears: "this.form is null".

What is the expected output? What do you see instead?
I expect that the watermark should be added to the control.
Instead I got the following:
>> Error: this.form is null | Source File: jquery.watermark.js | Line: 422

What version of the product are you using? On what operating system?
Product version: 3.0.1
Operating system: Windows XP Pro
Browser: Firefox 3.5.3

Please provide any additional information below.

Original issue reported on code.google.com by i.t.igna...@gmail.com on 4 Oct 2009 at 4:52

GoogleCodeExporter commented 9 years ago
I'll check it out, but when would you ever have input or textarea controls 
without a 
form?  Isn't that invalid HTML?

Original comment by t...@speednet.biz on 17 Oct 2009 at 2:19

GoogleCodeExporter commented 9 years ago
I am experiencing the same issue whilst using asp.net webforms... which always 
has a
form.

Original comment by a.cyberd...@gmail.com on 11 Nov 2009 at 12:39

GoogleCodeExporter commented 9 years ago
In general I guess that it's invalid HTML. However in my case I'm not using it 
to
submit data but only to filter the information on a page using JavaScript.

After I put a form element everything worked fine. Still I think it will be 
better if
it works even without form. As far as I remember in ASP.NET webforms it's 
possible to
have only one form.. and in some cases someone may need to put a control that
performs client-side-only tasks outside of this form.

In conclusion I think that if this is not hard to fix and won't introduce any
performance penalties maybe it's worth to be addressed.

P.S. Great plugin btw! :-)

Original comment by i.t.igna...@gmail.com on 11 Nov 2009 at 1:19

GoogleCodeExporter commented 9 years ago
FIXED IN VERSION 3.0.2.  Thank you for the feedback.

Added a test to ensure there is a form on the page before attempting to 
override the 
form submit function.

Original comment by t...@speednet.biz on 12 Nov 2009 at 2:19