[jQuery] Re: validation remote

2008-12-15 Thread Jet

Hi,

Sounds like we are having the same problem.

I have posted about the problem in this thread.

http://groups.google.com/group/jquery-en/browse_thread/thread/5d29f6e751ce5f3a?hl=en#

The thread above though refers to a field not using remote, but I'm
also having the same problem on another page when using remote.

URL: http://www.thaidatelink.com/account/register/

(checkout the "Username" field which I'm using "remote".)

Well...sorry I'm not of much help.

Just to bring to your attention about this similar thread and hope
that Jörn (the author of this wonderful script) could help.

Good luck!

;)

On Dec 15, 4:48 am, kemalemin  wrote:
> Hi, my validation summary worked quite fine before I made a remote
> username check available to it. The problem is when for the first time
> an already existing username is entered into the username box, the
> error div pops alright saying that the username already exists in the
> db. however when I go back and correct it, the error message
> disappears but the containing div still exists on the page. below is
> the code, I hope somebody can help
>
>  var container = $('#error_container');
>         // validate the form when it is submitted
>         var validator = $("#frmUserRegister").validate({
>             onkeyup: false,
>                 errorContainer: container,
>                 errorLabelContainer: $("ol", container),
>                 wrapper: 'li',
>                 meta: "validate",
>                 rules: {
>             txtFullName: {
>                 required: true,
>                 rangelength:[3, 100]},
>             txtUsername: {
>                 required: true,
>                 rangelength:[5, 30],
>                 remote:"ajaxCheckUsername.aspx"}, // returns 'true' or
> 'false' as string
>             txtEmail: {
>                 required: true,
>                 email: true},
>             txtPassword: {
>                 required: true,
>                 rangelength:[5, 20]},
>             txtConfirmPassword: {
>                 equalTo: "#txtPassword"}
>         },
>
>         messages: {
>             txtFullName: {
>                 required: "Please enter your full name strong>.",
>                 rangelength: "Fullname must be between 3 and
> 100 characters"},
>             txtUsername: {
>                 required: "Please enter a valid username strong>.",
>                 rangelength: "Username must be between 5 and
> 30 characters.",
>                 remote: jQuery.format("{0} is already
> taken, please choose a different username.")},
>             txtEmail: {
>                 required: "please provide an email
> address.",
>                 email: "please provide a valid email
> address"},
>             txtPassword: {
>                 required: "please provide a password strong>",
>                 rangelength: "Password must be  between 6 and
> 20 characters"},
>             txtConfirmPassword: {
>                 equalTo: "passwords must match."}
>         },
>         });
>
> });
>
>     
>
>     
> #error_container
> {
>     background-image:url(img/error.gif);
>     background-repeat:no-repeat;
>         background-color: #FFE8E8;
>         border: 1px solid #CC;
>         color: #CC;
>     font-family:Tahoma;
>     font-size:11px;
>     padding:4px 0 0 40px;
>     display: none;
>
> }
>
> #error_container ol li {
>         list-style-type:circle;
>
> }
>
> form.frmUserRegister label.frmUserRegister, label.error {
>         /* remove the next line when you have trouble in IE6 with labels in
> list */
>         color: #CC;
>
> }
>
> 
> 
> 
>     
>     
>         please review and correct the following errors:
>         
>             
>         
>         
>
>  the rest of the page are the form fields...
>
> here, the div with the id of "error_container" is still being
> displayed...


[jQuery] Re: [VALIDATION] Fields not updating numberOfInvalids count

2008-12-14 Thread Jet

Hi Jörn,

Thanks for responding :)

The problem is quite obvious if you could pls test the page with the
following action:

1) Go to URL: http://www.thaidatelink.com/page/delivery/

2) Check/Select the Radio button label "Yes"

3) Enter some text in the "Recipient's Email" or "Recipient's
Telephone" text field.

4) Focus elsewhere.

5) Now go back and delete/clear the text in the "Recipient's Email" or
"Recipient's Telephone" text field.

Result: the Error Summary (numberofinvalids) would show that
"Recipient's Email" or "Recipient's Telephone" as an invalid field
when it's blank (even though these are not required fields).

Hope you could help.

Thanks in advanced.


On Dec 14, 5:38 pm, "Jörn Zaefferer" 
wrote:
> Could you provide a simplified example that gives focus to the actual
> problem here?
>
> Jörn
>
>
>
> On Sat, Dec 13, 2008 at 9:16 PM, Jet  wrote:
>
> > Hi,
>
> > It's kind of difficult for me to explain for English is not my native
> > language.
>
> > I'll explain it briefly and refer you to the actual page.
>
> > If the 'Rule' for a field has a "Required" attribute and with or
> > without any other attributes, then it works fine.
>
> > But when a field has any other 'Rules' attribute other than
> > 'Required', and when the field is blank, it updated the
> > this.defaultShowErrors(); status but it doesn't update the
> > "numberOfInvalids" count (it will show there is (1) error).
>
> > Here is the actual page:http://www.thaidatelink.com/page/delivery/
>
> > Note1: no need to login to test the page, just click on the Radio or
> > Checkbox to display the form.
> > Fields without an asterisk sign (not required fields) are those which
> > has the problem. Type something into any of the following fields:
> > "Recipient's Email:", "Recipient's Telephone: " and "Message: " then
> > clear the field, and you shall see that the "this.defaultShowErrors
> > ();" staus will be updated as it should but the "numberOfInvalids"
> > notify of an error instead though the field isn't a "Required" field.
>
> > Hopefully someone could help for I have been trying to solve this
> > problem without success for the last three days.
>
> > Thanks in advanced.
>
> > Below is the code I used on the page:
>
> > 
> > $.validator.setDefaults({
> >        focusInvalid: false
> > });
>
> > $(document).ready(function(){
> > $("#error_summary_float").hide();
> > var v = $("#delivery_quotation").validate({
> >        rules: {
> >                 recipient_member: { required: true },
> >                 recipient_username: { required: true,
> >                                                 nowhitespace: true,
> >                                                 alphanumeric: true,
> >                                 minlength: 4,
> >                                 maxlength: 16 },
> >                 recipient_name: { required: true,
> >                           lettersspaces: true,
> >                           maxlength: 64 },
> >                 recipient_address: { required: true },
> >                recipient_email: { email: true,
> >                                 nowhitespace: true,
> >                                 maxlength: 64 },
> >                recipient_phone: { phonenumber: true,
> >                                   minlength: 9,
> >                                   maxlength: 32 },
> >                select_gifts: { required: true },
> >                "gifts[]": { required: true },
> >                greeting_card_to: { required: true,
> >                                            letterswithbasicpunc: true,
> >                                    maxlength: 64 },
> >                greeting_card_msg: { lettersnumberspuncspaces: true },
> >                greeting_card_from: { required: true,
> >                                       letterswithbasicpunc: true },
> >                instructions_requests: { maxlength: 500 },
> >                imgverify: { required: true,
> >                        minlength: 5,
> >                        nowhitespace: true,
> >                        lettersnumbers: true,
> >                        lowercaseletters: true }
> >                },
> >        messages: {
> >        recipient_member: { required: "Information required!" },
> >

[jQuery] [VALIDATION] Fields not updating numberOfInvalids count

2008-12-13 Thread Jet

Hi,

It's kind of difficult for me to explain for English is not my native
language.

I'll explain it briefly and refer you to the actual page.

If the 'Rule' for a field has a "Required" attribute and with or
without any other attributes, then it works fine.

But when a field has any other 'Rules' attribute other than
'Required', and when the field is blank, it updated the
this.defaultShowErrors(); status but it doesn't update the
"numberOfInvalids" count (it will show there is (1) error).

Here is the actual page: http://www.thaidatelink.com/page/delivery/

Note1: no need to login to test the page, just click on the Radio or
Checkbox to display the form.
Fields without an asterisk sign (not required fields) are those which
has the problem. Type something into any of the following fields:
"Recipient's Email:", "Recipient's Telephone: " and "Message: " then
clear the field, and you shall see that the "this.defaultShowErrors
();" staus will be updated as it should but the "numberOfInvalids"
notify of an error instead though the field isn't a "Required" field.

Hopefully someone could help for I have been trying to solve this
problem without success for the last three days.

Thanks in advanced.

Below is the code I used on the page:


$.validator.setDefaults({
focusInvalid: false
});

$(document).ready(function(){
$("#error_summary_float").hide();
var v = $("#delivery_quotation").validate({
rules: {
 recipient_member: { required: true },
 recipient_username: { required: true,
 nowhitespace: true,
 alphanumeric: true,
 minlength: 4,
 maxlength: 16 },
 recipient_name: { required: true,
   lettersspaces: true,
   maxlength: 64 },
 recipient_address: { required: true },
recipient_email: { email: true,
 nowhitespace: true,
 maxlength: 64 },
recipient_phone: { phonenumber: true,
   minlength: 9,
   maxlength: 32 },
select_gifts: { required: true },
"gifts[]": { required: true },
greeting_card_to: { required: true,
letterswithbasicpunc: true,
maxlength: 64 },
greeting_card_msg: { lettersnumberspuncspaces: true },
greeting_card_from: { required: true,
   letterswithbasicpunc: true },
instructions_requests: { maxlength: 500 },
imgverify: { required: true,
minlength: 5,
nowhitespace: true,
lettersnumbers: true,
lowercaseletters: true }
},
messages: {
recipient_member: { required: "Information required!" },
recipient_username: { required: "This field cannot be empty!",
nowhitespace: "No spaces allowed!!",
alphanumeric: "Letters, Numbers & Underscores 
only!",
minlength: "Minimum 4 characters long!",
maxlength: "Maximum 16 characters long!" },
recipient_name: { required: "This field cannot be empty!",
 letterswithbasicpunc: "Letters & 
Basic Punctuation
only!",
 maxlength: "Maximum 64 characters long!" },
recipient_address: { required: "This field cannot be empty!" },
recipient_email: { email: "Please enter a valid Email Address!",
 nowhitespace: "No spaces allowed!",
 maxlength: "Maximum 64 characters long!" },
recipient_phone: { phonenumber: "Numbers, Brackets & Hyphens
only!",
  minlength: "Minimum 9 digits long!",
  maxlength: "Maximum 16 digits long!" },
select_gifts: { required: "You have not selected any Gift!" },
"gifts[]": { required: "Please select at least one item!" },
greeting_card_to: { required: "This field cannot be empty!",
letterswithbasicpunc: "Letters & Basic 
Punctuation
only!",
maxlength: "Maximum 64 characters
long!" },
greeting_card_msg: {
lettersnumberspuncspaces: "Letters,
Numbers & Punctuation only!" },
greeting_card_from: { required: "This field cannot be empty!",
   letterswithbasicpunc: "Letters & Basic
Punctuation only!",
   maxlength: "Maximum 64 characters long!" },
instru