phranque

msg:4510920 | 5:43 pm on Oct 22, 2012 (gmt 0) |
do you get those error message from the on-page javascript form input validation or is that a response from server-side form input checking?
|
Rain_Lover

msg:4510923 | 5:47 pm on Oct 22, 2012 (gmt 0) |
I get validation error messages right next to the fields: Email >> Please enter a valid email address. URL >> Please enter a valid URL.
|
phranque

msg:4511063 | 1:34 am on Oct 23, 2012 (gmt 0) |
install the Live HTTP Headers add-on for Firefox and use this to determine if the GET or POST request is sent to the server when you click the form Submit button.
|
Rain_Lover

msg:4511065 | 1:39 am on Oct 23, 2012 (gmt 0) |
The error messages are provided by the validation plug-in. Here's a test: [dl.dropbox.com ]
|
daveVk

msg:4511103 | 4:35 am on Oct 23, 2012 (gmt 0) |
Change validate call $("#commentForm").validate({ignore: ".ignore"}); on focus after $(this).val(""); add $(this).removeClass('ignore'); and after $(this).val(this.defaultValue); add $(this).addClass('ignore');
|
Rain_Lover

msg:4511155 | 7:26 am on Oct 23, 2012 (gmt 0) |
Perfect! Thank you so much! :) Or even completely getting rid of the class attribute and then: on focus: this.className = 'url' on blur: this.className = '' without changing the validate call. Test: [dl.dropbox.com ] Any improvement to suggest?
|
daveVk

msg:4511266 | 11:52 am on Oct 23, 2012 (gmt 0) |
Fiddling the className needs a bit to extra logic. #curl => 'url' #cemail => ... etc and confuses matters if classes mentioned in css. In either case the 'value != element.defaultValue' test is now redundent in addMethod calls.
|
Rain_Lover

msg:4511285 | 1:47 pm on Oct 23, 2012 (gmt 0) |
| the 'value != element.defaultValue' test is now redundent in addMethod calls |
| I don't understand it. Would you mind explaining more?
|
daveVk

msg:4511481 | 12:02 am on Oct 24, 2012 (gmt 0) |
I see now that 'name' and 'comment' are mandatory, and this fix is not suitable for mandatory cases, so code is not redundant. In cases where fix applied, validator should not see case where value==default. Bottom line: Don't fiddle class on mandatory cases.
|
|