[jQuery] Re: (validation): remote rule causes submit to abort, fix included

2009-12-22 Thread KenGreer
No, it does not submit the form after the async request finishes. (I'm
using the latest 1.6)

Ken

On Dec 21, 6:30 am, Jörn Zaefferer joern.zaeffe...@googlemail.com
wrote:
 The plugin will submit the form after the async request finishes. The
 remaining problem is that any submit-button won't be submitted. Maybe thats
 the problem you had?

 Jörn



 On Mon, Dec 21, 2009 at 8:15 AM, KenGreer k...@dancesoft.com wrote:
  With the validation plugin (http://bassistance.de/jquery-plugins/
  jquery-plugin-validation/http://bassistance.de/jquery-plugins/%0Ajquery-plugin-validation/)
  I included two remote rules to check
  username and e-mail. If my form is loaded such that the username and e-
  mail are already filled in, and, therefore, have not yet been
  validated, and I click SUBMIT, validation proceeds just fine, but the
  form does NOT submit! A second click of the submit button, however,
  then works.

  I speculated that this was because of pending ajax calls aborting the
  submit. It seems my speculation held true. Right after my $
  (document).ready(function() { ... I added the code:

         $.ajaxSetup( {
                 async: false
         } );

  to make the remote ajax calls synchronous and this fixed the
  problem. Now clicking submit performs the validation and really does
  submit.

  Hopefully a more elegant solution will be found in the validation
  plugin itself, but as a jquery newbie, I found reading the validation
  plugin code daunting!


[jQuery] Re: [validation] Remote rule, show loading symbol

2009-07-08 Thread Jörn Zaefferer

You can use various ajax events to handle that, see:
http://docs.jquery.com/Ajax_Events

Eg. display the loading indicator on ajaxStart and hide it on ajaxStop.

Jörn

On Mon, Jul 6, 2009 at 8:02 PM, pimoussedelphine.ma...@gmail.com wrote:

 Hi,
 I am using a remote rule  an external file to check in a form that a
 username is available. I am trying to show a loading symbol (or a
 message that says checking your username is available ) while the
 ajax query is running. Does anyone here know how to do this?
 Thanks!



[jQuery] Re: validation remote

2009-02-08 Thread Kris

Another figure out the solution for this? I am having a similar
problem.

Thanks guys,
Kris

On Dec 15 2008, 4:17 am, Jet webones...@hotmail.com wrote:
 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/5d29f6e...

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

 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 kemale...@gmail.com wrote:

  Hi, myvalidationsummary worked quite fine before I made aremote
  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 strongfull name/
  strong.,
                  rangelength: Fullname must be strongbetween 3 and
  100 characters/strong},
              txtUsername: {
                  required: Please enter a strongvalid username/
  strong.,
                  rangelength: Username must be strongbetween 5 and
  30 characters/strong.,
                 remote: jQuery.format(strongu{0}/u is already
  taken/strong, please choose a different username.)},
              txtEmail: {
                  required: please provide an strongemail/strong
  address.,
                  email: please provide a strongvalid email/strong
  address},
              txtPassword: {
                  required: please provide a strongpassword/
  strong,
                  rangelength: Password must be strong between 6 and
  20 characters/strong},
              txtConfirmPassword: {
                  equalTo: passwords strongmust match/strong.}
          },
          });

  });

      /script

      style type=text/css
  #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;

  }

  /style
  /head
  body
      form id=frmUserRegister runat=server
      div id=error_container
          strongplease review and correct the following errors:/strong
          ol
              li style=display:none;/li
          /ol
          /div

   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 remote

2009-02-08 Thread Jörn Zaefferer

This is probably a bug that occurs only in combination of error
containers and the remote methods. I'll look into it.

Jörn

On Sun, Feb 8, 2009 at 6:07 PM, Kris k...@kriskhoury.com wrote:

 Another figure out the solution for this? I am having a similar
 problem.

 Thanks guys,
 Kris

 On Dec 15 2008, 4:17 am, Jet webones...@hotmail.com wrote:
 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/5d29f6e...

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

 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 kemale...@gmail.com wrote:

  Hi, myvalidationsummary worked quite fine before I made aremote
  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 strongfull name/
  strong.,
  rangelength: Fullname must be strongbetween 3 and
  100 characters/strong},
  txtUsername: {
  required: Please enter a strongvalid username/
  strong.,
  rangelength: Username must be strongbetween 5 and
  30 characters/strong.,
 remote: jQuery.format(strongu{0}/u is already
  taken/strong, please choose a different username.)},
  txtEmail: {
  required: please provide an strongemail/strong
  address.,
  email: please provide a strongvalid email/strong
  address},
  txtPassword: {
  required: please provide a strongpassword/
  strong,
  rangelength: Password must be strong between 6 and
  20 characters/strong},
  txtConfirmPassword: {
  equalTo: passwords strongmust match/strong.}
  },
  });

  });

  /script

  style type=text/css
  #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;

  }

  /style
  /head
  body
  form id=frmUserRegister runat=server
  div id=error_container
  strongplease review and correct the following errors:/strong
  ol
  li style=display:none;/li
  /ol
  /div

   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 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 kemale...@gmail.com 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 strongfull name/
 strong.,
                 rangelength: Fullname must be strongbetween 3 and
 100 characters/strong},
             txtUsername: {
                 required: Please enter a strongvalid username/
 strong.,
                 rangelength: Username must be strongbetween 5 and
 30 characters/strong.,
                 remote: jQuery.format(strongu{0}/u is already
 taken/strong, please choose a different username.)},
             txtEmail: {
                 required: please provide an strongemail/strong
 address.,
                 email: please provide a strongvalid email/strong
 address},
             txtPassword: {
                 required: please provide a strongpassword/
 strong,
                 rangelength: Password must be strong between 6 and
 20 characters/strong},
             txtConfirmPassword: {
                 equalTo: passwords strongmust match/strong.}
         },
         });

 });

     /script

     style type=text/css
 #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;

 }

 /style
 /head
 body
     form id=frmUserRegister runat=server
     div id=error_container
         strongplease review and correct the following errors:/strong
         ol
             li style=display:none;/li
         /ol
         /div

  the rest of the page are the form fields...

 here, the div with the id of error_container is still being
 displayed...