[jQuery] Re: Validation Plugin

2010-01-10 Thread Adrian Lynch
Got any code to show us?

You need an event to fire off the remote call, either onBlur or
onClick of a button. You examine the returned data and act
accordingly.

Adrian

On Jan 10, 12:28 pm, Richard Beacroft  wrote:
> People enter an address to lookup on a google map, this makes an
> asynchronous call and will either return a lat/longitude or not. if
> not, i want to display an error to the user that an address could not
> be found.
>
> How do I go about this? I've not managed to get it working using the
> remote attribute as I really need to call a client-side js function
> which will in turn make the async call. Any suggestions?
>
> Regards,
> Rik


[jQuery] Re: Validation plugin rules() ???

2009-11-16 Thread Jules
http://docs.jquery.com/Plugins/Validation/Methods

Also, I found it was worth while to look into jquery.validation.js
code.

On Nov 17, 8:55 am, "Atkinson, Sarah" 
wrote:
> Is there a list somewhere of what the options are for the rules (required, 
> email)
> I can't seem to find more info on this in the jquery site.


[jQuery] Re: Validation Plugin + jNice

2009-11-13 Thread Samuurai
Ahhh...

Ok, I might opt for just putting an error message after the element
instead then rather than creating a box like i'm doing now.

Many thanks Jorn for your help!

On Nov 13, 5:43 pm, Jörn Zaefferer 
wrote:
> Then this:
>
> ,success: function(element){
> 157 var errorDiv = element.parents('.error');
> 158 element.remove();
> 159 errorDiv.siblings().remove();
> 160 errorDiv.replaceWith(errorDiv.children());
> 161 }
>
> You replace the div? That causing the DOM to rerender, including the input,
> killing the focus.
>
> Jörn
>
> On Fri, Nov 13, 2009 at 6:17 PM, Samuurai  wrote:
> > Strangely, It seems to be doing it even after removing jNice. - I've
> > updated the test site.
>
> > On Nov 13, 4:23 pm, Jörn Zaefferer 
> > wrote:
> > > Looks like jNice is causing that issue. Did you try removing that to see
> > > what happens?
>
> > > Jörn
>
> > > On Fri, Nov 13, 2009 at 4:58 PM, Samuurai  wrote:
> > > > Yeah..
>
> > > >www.racedaystaff.com-log in as jorn/jorn then click "proceed to
> > > > site" then click "register" at the top.
>
> > > > Thanks for looking at this !
>
> > > > On Nov 13, 3:51 pm, Jörn Zaefferer 
> > > > wrote:
> > > > > Do you have a testpage?
>
> > > > > Jörn
>
> > > > > On Fri, Nov 13, 2009 at 4:40 PM, Samuurai  wrote:
> > > > > > I'm having a strange problem with jNice and the validation plugin.
>
> > > > > > Probably the easiest way to describe the error is by giving an
> > > > > > example.
>
> > > > > > I load the page with my form on it, then without typing anything, I
> > > > > > click submit. The jQuery validation plugin puts errors around my
> > > > > > fields saying "This field is required".
>
> > > > > > However, when I try to type something into the input fields to
> > satisfy
> > > > > > the validation, I can type a couple of letters, three or four if
> > i'm
> > > > > > really fast, but as the validation plugin removes the error box, it
> > > > > > shifts focus away from the input box.
>
> > > > > > Strangely, this same behaviour continues on the same field even
> > after
> > > > > > the error box has been removed.. the focus gets 'stolen'.
>
> > > > > > Has anyone had any experience using jQuery validation plugin with
> > > > > > jNice?


Re: [jQuery] Re: Validation Plugin + jNice

2009-11-13 Thread Jörn Zaefferer
Then this:

,success: function(element){
157 var errorDiv = element.parents('.error');
158 element.remove();
159 errorDiv.siblings().remove();
160 errorDiv.replaceWith(errorDiv.children());
161 }

You replace the div? That causing the DOM to rerender, including the input,
killing the focus.

Jörn


On Fri, Nov 13, 2009 at 6:17 PM, Samuurai  wrote:

> Strangely, It seems to be doing it even after removing jNice. - I've
> updated the test site.
>
> On Nov 13, 4:23 pm, Jörn Zaefferer 
> wrote:
> > Looks like jNice is causing that issue. Did you try removing that to see
> > what happens?
> >
> > Jörn
> >
> > On Fri, Nov 13, 2009 at 4:58 PM, Samuurai  wrote:
> > > Yeah..
> >
> > >www.racedaystaff.com- log in as jorn/jorn then click "proceed to
> > > site" then click "register" at the top.
> >
> > > Thanks for looking at this !
> >
> > > On Nov 13, 3:51 pm, Jörn Zaefferer 
> > > wrote:
> > > > Do you have a testpage?
> >
> > > > Jörn
> >
> > > > On Fri, Nov 13, 2009 at 4:40 PM, Samuurai  wrote:
> > > > > I'm having a strange problem with jNice and the validation plugin.
> >
> > > > > Probably the easiest way to describe the error is by giving an
> > > > > example.
> >
> > > > > I load the page with my form on it, then without typing anything, I
> > > > > click submit. The jQuery validation plugin puts errors around my
> > > > > fields saying "This field is required".
> >
> > > > > However, when I try to type something into the input fields to
> satisfy
> > > > > the validation, I can type a couple of letters, three or four if
> i'm
> > > > > really fast, but as the validation plugin removes the error box, it
> > > > > shifts focus away from the input box.
> >
> > > > > Strangely, this same behaviour continues on the same field even
> after
> > > > > the error box has been removed.. the focus gets 'stolen'.
> >
> > > > > Has anyone had any experience using jQuery validation plugin with
> > > > > jNice?
>


[jQuery] Re: Validation Plugin + jNice

2009-11-13 Thread Samuurai
Strangely, It seems to be doing it even after removing jNice. - I've
updated the test site.

On Nov 13, 4:23 pm, Jörn Zaefferer 
wrote:
> Looks like jNice is causing that issue. Did you try removing that to see
> what happens?
>
> Jörn
>
> On Fri, Nov 13, 2009 at 4:58 PM, Samuurai  wrote:
> > Yeah..
>
> >www.racedaystaff.com- log in as jorn/jorn then click "proceed to
> > site" then click "register" at the top.
>
> > Thanks for looking at this !
>
> > On Nov 13, 3:51 pm, Jörn Zaefferer 
> > wrote:
> > > Do you have a testpage?
>
> > > Jörn
>
> > > On Fri, Nov 13, 2009 at 4:40 PM, Samuurai  wrote:
> > > > I'm having a strange problem with jNice and the validation plugin.
>
> > > > Probably the easiest way to describe the error is by giving an
> > > > example.
>
> > > > I load the page with my form on it, then without typing anything, I
> > > > click submit. The jQuery validation plugin puts errors around my
> > > > fields saying "This field is required".
>
> > > > However, when I try to type something into the input fields to satisfy
> > > > the validation, I can type a couple of letters, three or four if i'm
> > > > really fast, but as the validation plugin removes the error box, it
> > > > shifts focus away from the input box.
>
> > > > Strangely, this same behaviour continues on the same field even after
> > > > the error box has been removed.. the focus gets 'stolen'.
>
> > > > Has anyone had any experience using jQuery validation plugin with
> > > > jNice?


Re: [jQuery] Re: Validation Plugin + jNice

2009-11-13 Thread Jörn Zaefferer
Looks like jNice is causing that issue. Did you try removing that to see
what happens?

Jörn

On Fri, Nov 13, 2009 at 4:58 PM, Samuurai  wrote:

> Yeah..
>
> www.racedaystaff.com - log in as jorn/jorn then click "proceed to
> site" then click "register" at the top.
>
> Thanks for looking at this !
>
> On Nov 13, 3:51 pm, Jörn Zaefferer 
> wrote:
> > Do you have a testpage?
> >
> > Jörn
> >
> > On Fri, Nov 13, 2009 at 4:40 PM, Samuurai  wrote:
> > > I'm having a strange problem with jNice and the validation plugin.
> >
> > > Probably the easiest way to describe the error is by giving an
> > > example.
> >
> > > I load the page with my form on it, then without typing anything, I
> > > click submit. The jQuery validation plugin puts errors around my
> > > fields saying "This field is required".
> >
> > > However, when I try to type something into the input fields to satisfy
> > > the validation, I can type a couple of letters, three or four if i'm
> > > really fast, but as the validation plugin removes the error box, it
> > > shifts focus away from the input box.
> >
> > > Strangely, this same behaviour continues on the same field even after
> > > the error box has been removed.. the focus gets 'stolen'.
> >
> > > Has anyone had any experience using jQuery validation plugin with
> > > jNice?
>


[jQuery] Re: Validation Plugin + jNice

2009-11-13 Thread Samuurai
Sorry - I have a goldfish memory today. - Repeating myself :p

On Nov 13, 4:01 pm, Samuurai  wrote:
> Oh - Log in as jorn/jorn
>
> On Nov 13, 3:58 pm, Samuurai  wrote:
>
> > Yeah..
>
> >www.racedaystaff.com-log in as jorn/jorn then click "proceed to
> > site" then click "register" at the top.
>
> > Thanks for looking at this !
>
> > On Nov 13, 3:51 pm, Jörn Zaefferer 
> > wrote:
>
> > > Do you have a testpage?
>
> > > Jörn
>
> > > On Fri, Nov 13, 2009 at 4:40 PM, Samuurai  wrote:
> > > > I'm having a strange problem with jNice and the validation plugin.
>
> > > > Probably the easiest way to describe the error is by giving an
> > > > example.
>
> > > > I load the page with my form on it, then without typing anything, I
> > > > click submit. The jQuery validation plugin puts errors around my
> > > > fields saying "This field is required".
>
> > > > However, when I try to type something into the input fields to satisfy
> > > > the validation, I can type a couple of letters, three or four if i'm
> > > > really fast, but as the validation plugin removes the error box, it
> > > > shifts focus away from the input box.
>
> > > > Strangely, this same behaviour continues on the same field even after
> > > > the error box has been removed.. the focus gets 'stolen'.
>
> > > > Has anyone had any experience using jQuery validation plugin with
> > > > jNice?


[jQuery] Re: Validation Plugin + jNice

2009-11-13 Thread Samuurai
Oh - Log in as jorn/jorn

On Nov 13, 3:58 pm, Samuurai  wrote:
> Yeah..
>
> www.racedaystaff.com- log in as jorn/jorn then click "proceed to
> site" then click "register" at the top.
>
> Thanks for looking at this !
>
> On Nov 13, 3:51 pm, Jörn Zaefferer 
> wrote:
>
> > Do you have a testpage?
>
> > Jörn
>
> > On Fri, Nov 13, 2009 at 4:40 PM, Samuurai  wrote:
> > > I'm having a strange problem with jNice and the validation plugin.
>
> > > Probably the easiest way to describe the error is by giving an
> > > example.
>
> > > I load the page with my form on it, then without typing anything, I
> > > click submit. The jQuery validation plugin puts errors around my
> > > fields saying "This field is required".
>
> > > However, when I try to type something into the input fields to satisfy
> > > the validation, I can type a couple of letters, three or four if i'm
> > > really fast, but as the validation plugin removes the error box, it
> > > shifts focus away from the input box.
>
> > > Strangely, this same behaviour continues on the same field even after
> > > the error box has been removed.. the focus gets 'stolen'.
>
> > > Has anyone had any experience using jQuery validation plugin with
> > > jNice?


[jQuery] Re: Validation Plugin + jNice

2009-11-13 Thread Samuurai
Yeah..

www.racedaystaff.com - log in as jorn/jorn then click "proceed to
site" then click "register" at the top.

Thanks for looking at this !

On Nov 13, 3:51 pm, Jörn Zaefferer 
wrote:
> Do you have a testpage?
>
> Jörn
>
> On Fri, Nov 13, 2009 at 4:40 PM, Samuurai  wrote:
> > I'm having a strange problem with jNice and the validation plugin.
>
> > Probably the easiest way to describe the error is by giving an
> > example.
>
> > I load the page with my form on it, then without typing anything, I
> > click submit. The jQuery validation plugin puts errors around my
> > fields saying "This field is required".
>
> > However, when I try to type something into the input fields to satisfy
> > the validation, I can type a couple of letters, three or four if i'm
> > really fast, but as the validation plugin removes the error box, it
> > shifts focus away from the input box.
>
> > Strangely, this same behaviour continues on the same field even after
> > the error box has been removed.. the focus gets 'stolen'.
>
> > Has anyone had any experience using jQuery validation plugin with
> > jNice?


[jQuery] Re: validation plugin addMethod does not work for me.

2009-10-22 Thread JMan

Thanks Leonardo...

I figured it out after digging through several examples. The
documentation for this plugin has a huge gap in it. It shows an
example of how to define a custom validator but no where does it
explain how to use it. The trick being as you mentioned, defining it
in the Rules or you can put the name of your custom validator in the
class attribute of the field it applies to.

The sad part is after hours of struggling with this it does not work
as I had hoped it would. I am prompting the user for input and based
on their response I would like to either cancel the form submit or
allow it to continue.




On Oct 22, 11:48 am, Leonardo K  wrote:
> One thing is your method name and other is your field name. If the name of
> your field is company and your method is company so:
>
> rules:{
>     company:{
>          company:true
>     }
>
> }
>
> Maybe is better rename your method to not confuse.
>
> On Thu, Oct 22, 2009 at 13:24, JMan  wrote:
>
> > Still no go... below is my code. I just want to pop a dialog to ask
> > the user if they are sure they want to leave the company name blank.
> > The field is not required. I thought it would be easier than this? I
> > can't get teh addMethod to work or fire at all on validation.
>
> > //validates the form
> >                var validator = frmSubmittal.validate({
> >                                                         debug: false,
> >                                                        focusCleanup: false,
> >                                                        focusInvalid: false,
> >                                                        onfocusout: false,
> >                                                        onkeyup: false,
> >                                                        errorPlacement:
> > function(error, element) {error.prependTo
> > ( element.parents("div.ctrlHolder"));},
> >                                                        errorElement:'div',
>
> >  errorClass:'valerror',
> >                                                        rules: {
>
> >  restitutionaddress: {required: "#sameAsBusinessAddress
> > [checked='false']"},
>
> >  restitutioncity: {required: "#sameAsBusinessAddress
> > [checked='false']"},
>
> >  restitutionstate: {required: "#sameAsBusinessAddress
> > [checked='false']"},
>
> >  restitutionzipcode: {required: "#sameAsBusinessAddress
> > [checked='false']"},
>
> >  company:true
> >                                                                 }
>
> >                });
>
> >                $.validator.addMethod( "company", function(value, element)
> > {alert
> > ("hello"); return false;}, "Enter a Company Name" );
>
> > On Oct 21, 9:18 pm, Leonardo K  wrote:
> > > U need set the rules for your validation:
>
> > > frmSubmittal.validate({
> > >     debug: false,
> > >     focusCleanup: false,
> > >     focusInvalid: false,
> > >     onfocusout: false,
> > >     onkeyup: false,
> > >     errorPlacement: function(error, element) {
> > >         error.prependTo( element.parents("div.ctrlHolder"));
> > >     },
> > >     errorElement:'div',
> > >     errorClass:'valerror',
> > >     rules:{
> > >         nameField:{
> > >             company:true
> > >         }
> > >     }
>
> > > });
> > > On Wed, Oct 21, 2009 at 22:04, JMan  wrote:
>
> > > > what am I doing wrong here? I cannot figure out how to use the
> > > > addMethod().
>
> > > > var frmSubmittal = $("#frmSubmittal");
>
> > > > //validates the form
> > > > frmSubmittal.validate({
> > > >                                                        debug: false,
> > > >                                                        focusCleanup:
> > false,
> > > >                                                        focusInvalid:
> > false,
> > > >                                                        onfocusout:
> > false,
> > > >                                                        onkeyup: false,
> > > >                                                        errorPlacement:
> > > > function(error, element) {error.prependTo
> > > > ( element.parents("div.ctrlHolder"));},
>
> >  errorElement:'div',
>
> > > >  errorClass:'valerror'
>
> > > > });
>
> > > > $.validator.addMethod( "company", function(value, element) {alert
> > > > ("hello"); return false;}, "Enter a Company Name" );


[jQuery] Re: validation plugin addMethod does not work for me.

2009-10-22 Thread Leonardo K
One thing is your method name and other is your field name. If the name of
your field is company and your method is company so:

rules:{
company:{
 company:true
}
}

Maybe is better rename your method to not confuse.


On Thu, Oct 22, 2009 at 13:24, JMan  wrote:

>
> Still no go... below is my code. I just want to pop a dialog to ask
> the user if they are sure they want to leave the company name blank.
> The field is not required. I thought it would be easier than this? I
> can't get teh addMethod to work or fire at all on validation.
>
>
> //validates the form
>var validator = frmSubmittal.validate({
> debug: false,
>focusCleanup: false,
>focusInvalid: false,
>onfocusout: false,
>onkeyup: false,
>errorPlacement:
> function(error, element) {error.prependTo
> ( element.parents("div.ctrlHolder"));},
>errorElement:'div',
>
>  errorClass:'valerror',
>rules: {
>
>  restitutionaddress: {required: "#sameAsBusinessAddress
> [checked='false']"},
>
>  restitutioncity: {required: "#sameAsBusinessAddress
> [checked='false']"},
>
>  restitutionstate: {required: "#sameAsBusinessAddress
> [checked='false']"},
>
>  restitutionzipcode: {required: "#sameAsBusinessAddress
> [checked='false']"},
>
>  company:true
> }
>
>});
>
>$.validator.addMethod( "company", function(value, element)
> {alert
> ("hello"); return false;}, "Enter a Company Name" );
>
>
>
>
>
>
> On Oct 21, 9:18 pm, Leonardo K  wrote:
> > U need set the rules for your validation:
> >
> > frmSubmittal.validate({
> > debug: false,
> > focusCleanup: false,
> > focusInvalid: false,
> > onfocusout: false,
> > onkeyup: false,
> > errorPlacement: function(error, element) {
> > error.prependTo( element.parents("div.ctrlHolder"));
> > },
> > errorElement:'div',
> > errorClass:'valerror',
> > rules:{
> > nameField:{
> > company:true
> > }
> > }
> >
> > });
> > On Wed, Oct 21, 2009 at 22:04, JMan  wrote:
> >
> > > what am I doing wrong here? I cannot figure out how to use the
> > > addMethod().
> >
> > > var frmSubmittal = $("#frmSubmittal");
> >
> > > //validates the form
> > > frmSubmittal.validate({
> > >debug: false,
> > >focusCleanup:
> false,
> > >focusInvalid:
> false,
> > >onfocusout:
> false,
> > >onkeyup: false,
> > >errorPlacement:
> > > function(error, element) {error.prependTo
> > > ( element.parents("div.ctrlHolder"));},
> > >
>  errorElement:'div',
> >
> > >  errorClass:'valerror'
> >
> > > });
> >
> > > $.validator.addMethod( "company", function(value, element) {alert
> > > ("hello"); return false;}, "Enter a Company Name" );
>


[jQuery] Re: validation plugin addMethod does not work for me.

2009-10-22 Thread JMan

Still no go... below is my code. I just want to pop a dialog to ask
the user if they are sure they want to leave the company name blank.
The field is not required. I thought it would be easier than this? I
can't get teh addMethod to work or fire at all on validation.


//validates the form
var validator = frmSubmittal.validate({
debug: false,
focusCleanup: false,
focusInvalid: false,
onfocusout: false,
onkeyup: false,
errorPlacement: 
function(error, element) {error.prependTo
( element.parents("div.ctrlHolder"));},
errorElement:'div',
errorClass:'valerror',
rules: {

restitutionaddress: {required: "#sameAsBusinessAddress
[checked='false']"},

restitutioncity: {required: "#sameAsBusinessAddress
[checked='false']"},

restitutionstate: {required: "#sameAsBusinessAddress
[checked='false']"},

restitutionzipcode: {required: "#sameAsBusinessAddress
[checked='false']"},

company:true
}

});

$.validator.addMethod( "company", function(value, element) 
{alert
("hello"); return false;}, "Enter a Company Name" );






On Oct 21, 9:18 pm, Leonardo K  wrote:
> U need set the rules for your validation:
>
> frmSubmittal.validate({
>     debug: false,
>     focusCleanup: false,
>     focusInvalid: false,
>     onfocusout: false,
>     onkeyup: false,
>     errorPlacement: function(error, element) {
>         error.prependTo( element.parents("div.ctrlHolder"));
>     },
>     errorElement:'div',
>     errorClass:'valerror',
>     rules:{
>         nameField:{
>             company:true
>         }
>     }
>
> });
> On Wed, Oct 21, 2009 at 22:04, JMan  wrote:
>
> > what am I doing wrong here? I cannot figure out how to use the
> > addMethod().
>
> > var frmSubmittal = $("#frmSubmittal");
>
> > //validates the form
> > frmSubmittal.validate({
> >                                                        debug: false,
> >                                                        focusCleanup: false,
> >                                                        focusInvalid: false,
> >                                                        onfocusout: false,
> >                                                        onkeyup: false,
> >                                                        errorPlacement:
> > function(error, element) {error.prependTo
> > ( element.parents("div.ctrlHolder"));},
> >                                                        errorElement:'div',
>
> >  errorClass:'valerror'
>
> > });
>
> > $.validator.addMethod( "company", function(value, element) {alert
> > ("hello"); return false;}, "Enter a Company Name" );


[jQuery] Re: validation plugin addMethod does not work for me.

2009-10-21 Thread Leonardo K
U need set the rules for your validation:

frmSubmittal.validate({
debug: false,
focusCleanup: false,
focusInvalid: false,
onfocusout: false,
onkeyup: false,
errorPlacement: function(error, element) {
error.prependTo( element.parents("div.ctrlHolder"));
},
errorElement:'div',
errorClass:'valerror',
rules:{
nameField:{
company:true
}
}

});


On Wed, Oct 21, 2009 at 22:04, JMan  wrote:

>
> what am I doing wrong here? I cannot figure out how to use the
> addMethod().
>
> var frmSubmittal = $("#frmSubmittal");
>
> //validates the form
> frmSubmittal.validate({
>debug: false,
>focusCleanup: false,
>focusInvalid: false,
>onfocusout: false,
>onkeyup: false,
>errorPlacement:
> function(error, element) {error.prependTo
> ( element.parents("div.ctrlHolder"));},
>errorElement:'div',
>
>  errorClass:'valerror'
>
> });
>
> $.validator.addMethod( "company", function(value, element) {alert
> ("hello"); return false;}, "Enter a Company Name" );
>


[jQuery] Re: Validation plugin: textarea to allow only digits, but allowing linebreaks?

2009-10-15 Thread Leonardo K
You can create your own validate method:
http://docs.jquery.com/Plugins/Validation/Validator/addMethod#namemethodmessage

jQuery.validator.addMethod("digitsAndLineBreak", function(value, element) {
return /^[\d|\n]+$/.test(value);
}, "Please enter only digits");

then:

$("#quicksend_form").validate({
rules: {
recepients: {
required: true,
digitsAndLineBreak: true,
minlength: 10
}
}
});

On Thu, Oct 15, 2009 at 15:57, Renie  wrote:

>
> I'm using the Jquery Validation Plugin on my site, and I have a
> textfield that validates to only allow numbers. However, that also
> doesn't allow linebreaks - which I need to have! Is there a way around
> this?
>
> Here's the working code:
>
>
> 
> 
> http://code.jquery.com/jquery-latest.js";>
> http://dev.jquery.com/view/trunk/
> plugins/validate/jquery.validate.js<http://dev.jquery.com/view/trunk/%0Aplugins/validate/jquery.validate.js>
> ">
> 
> $(document).ready(function() { // Doc Ready Functions
>
> $("#quicksend_form").validate({
>rules: {
>recepients: {
>  required: true,
>  digits: true,
>  minlength: 10
>}
>}
> });
>
> }); // Doc Ready Functions
> 
>
> 
>
> 
>
>  name="quicksend_form" id="quicksend_form">
> 
> 
> 
>
>  
>


[jQuery] Re: Validation plugin 1.5.5 error in IE6

2009-07-23 Thread Rio

It would be great if you could post your repacked version for us.

Thanks!

-Mario


[jQuery] Re: Validation plugin 1.5.5 error in IE6

2009-07-23 Thread Rio

I found this link: 
http://return-true.com/2008/12/fixing-jquery-validator-plugin-in-internet-explorer-6/

Looks like it's a character set issue.

-Mario



On Jun 29, 4:21 pm, Tristan  wrote:
> The jquery.validate.pack.js file found 
> onhttp://bassistance.de/jquery-plugins/jquery-plugin-validation/causes
> an error when run in IE6.
>


[jQuery] Re: Validation plugin - submit form without validation

2009-07-20 Thread Jules

Try $("#frm")[0].submit()

On Jul 20, 1:56 pm, Adam P  wrote:
> I'm using the Validation plugin for JQuery and was wondering if there
> was a function to submit the form without causing it to validate the
> form.  I have a table with a list of radio-buttons and above that is a
> drop down list of states.  The drop down list of states is used to
> filter the table rows and when the selected item changes it posts-back
> to the server (via $("#frm").submit()).  I don't want this to cause
> any validation to occur.  Is there another function I can call besides
> submit(), or some other method?
>
> Thanks


[jQuery] Re: Validation plugin - Using with 'button' buttons?

2009-04-22 Thread Brad

In the button's click handler:

if ($("#myform").validate().form()) {
// submit form
}


On Apr 22, 9:48 am, Brad  wrote:
> To be more specific, validation is working prior to clicking the
> button. For example I have a date field in the form and entering
> garbage will present an "enter a valid date" message, but I also have
> some fields that are simply required. Clicking the button doesn't
> appear to run any pre-submit validation.
>
> BTW, I'm totally new to this plugin.
>
> On Apr 22, 9:39 am, Brad  wrote:
>
> > I'm trying to integrate the Validation plugin into an existing
> > project. The forms use AJAX and the buttons are not of type 'submit',
> > but type 'button'. If I change the type to 'submit' I can see
> > validation works, but doing so will require other code changes. Is
> > there any way to get it to work with a 'button' button?


[jQuery] Re: Validation plugin - Using with 'button' buttons?

2009-04-22 Thread Brad

To be more specific, validation is working prior to clicking the
button. For example I have a date field in the form and entering
garbage will present an "enter a valid date" message, but I also have
some fields that are simply required. Clicking the button doesn't
appear to run any pre-submit validation.

BTW, I'm totally new to this plugin.

On Apr 22, 9:39 am, Brad  wrote:
> I'm trying to integrate the Validation plugin into an existing
> project. The forms use AJAX and the buttons are not of type 'submit',
> but type 'button'. If I change the type to 'submit' I can see
> validation works, but doing so will require other code changes. Is
> there any way to get it to work with a 'button' button?


[jQuery] Re: Validation plugin (bassistance.de) problem

2009-04-22 Thread Jonas

Yeah, I know about the regular behaviour, but the problem is that the
live validation behaves incorrect.

When it validates an input as valid, it sometimes doesn't revalidate
it when you clear the field (so it should state as invalid, but it
still says it's valid).

The behaviours is random. Sometimes it happens on the first field,
sometimes on another.

On Apr 17, 2:17 pm, Jörn Zaefferer 
wrote:
> The behaviour is described 
> here:http://docs.jquery.com/Plugins/Validation/Reference#Validation_event
>
> Jörn
>
> On Fri, Apr 17, 2009 at 10:46 AM, Jonas  wrote:
>
> > Example form:http://jquery.bassistance.de/validate/demo/milk/
> > (this is the demo for the script onbassistance.de)
>
> > When it does 'live' validation (on blur) it tells the user if the
> > field is correct or incorrect. When you fill in the first field, tab
> > to the next field, go back to the previous (allready filled in) field
> > and clear it, it still counts as valid (notice the icon next to the
> > field).
>
> > Since the field is now empty, it should state as invalid, but it
> > doesn't.
>
> > This behaviour is random, sometimes it works, sometimes it doesn't.
> > Sometimes it happens in the first field, sometimes on one of the
> > other.
>
> >  It only happens before you try to submit the form, after a page
> > submit everything works fine.
>
> > Anybody who has a clue?


[jQuery] Re: Validation plugin (bassistance.de) problem

2009-04-17 Thread Tom Worster
i also detected some difference between the demo's behavior and the docs.
i'm not sure what sequence of ui actions led to the result in the attached
png but i've seen it twice now.

On 4/17/09 8:17 AM, "Jörn Zaefferer"  wrote:

> 
> The behaviour is described here:
> http://docs.jquery.com/Plugins/Validation/Reference#Validation_event
> 
> Jörn
> 
> On Fri, Apr 17, 2009 at 10:46 AM, Jonas  wrote:
>> 
>> Example form: http://jquery.bassistance.de/validate/demo/milk/
>> (this is the demo for the script on bassistance.de)
>> 
>> When it does 'live' validation (on blur) it tells the user if the
>> field is correct or incorrect. When you fill in the first field, tab
>> to the next field, go back to the previous (allready filled in) field
>> and clear it, it still counts as valid (notice the icon next to the
>> field).
>> 
>> Since the field is now empty, it should state as invalid, but it
>> doesn't.
>> 
>> This behaviour is random, sometimes it works, sometimes it doesn't.
>> Sometimes it happens in the first field, sometimes on one of the
>> other.
>> 
>>  It only happens before you try to submit the form, after a page
>> submit everything works fine.
>> 
>> Anybody who has a clue?
>> 

<>

[jQuery] Re: Validation plugin (bassistance.de) problem

2009-04-17 Thread Jörn Zaefferer

The behaviour is described here:
http://docs.jquery.com/Plugins/Validation/Reference#Validation_event

Jörn

On Fri, Apr 17, 2009 at 10:46 AM, Jonas  wrote:
>
> Example form: http://jquery.bassistance.de/validate/demo/milk/
> (this is the demo for the script on bassistance.de)
>
> When it does 'live' validation (on blur) it tells the user if the
> field is correct or incorrect. When you fill in the first field, tab
> to the next field, go back to the previous (allready filled in) field
> and clear it, it still counts as valid (notice the icon next to the
> field).
>
> Since the field is now empty, it should state as invalid, but it
> doesn't.
>
> This behaviour is random, sometimes it works, sometimes it doesn't.
> Sometimes it happens in the first field, sometimes on one of the
> other.
>
>  It only happens before you try to submit the form, after a page
> submit everything works fine.
>
> Anybody who has a clue?
>


[jQuery] Re: Validation plugin remote problem

2009-04-13 Thread Jörn Zaefferer
The response for the remote request is wrong:
http://betan.midoo.se/?data%5BUser%5D%5Bemail%5D=bla%40bla.com
That should be just "true", nothing else.

And, completely unrelated: The error message isn't hidden for a valid
field. You can check the state of the field in Firebug. Once its
valid, the error-class is removed. But the error label isn't hidden,
for whatever reason.

To debug this, please include an uncompressed jquery.validate.js file
and enable the debug option (debug:true).

Jörn

On Tue, Apr 14, 2009 at 12:06 AM, Victorr  wrote:
>
> Sure. I translated the error messages to english so that you would
> understand :)
> http://betan.midoo.se
>
> On 13 Apr, 16:28, Jörn Zaefferer 
> wrote:
>> Could you post a testpage? Can't see anything wrong in the snippets
>> you provided - its probably something seemingly unrelated.
>>
>> Jörn
>>
>> On Sun, Apr 12, 2009 at 4:18 PM, Victorr  wrote:
>>
>> > Ok. But what do i need too echo to get a false value and an error
>> > message?
>>
>> > thanks!
>>
>> > On 12 Apr, 10:37, Jörn Zaefferer 
>> > wrote:
>> >> You need to echo "true" for a valid value.
>>
>> >> Jörn
>>
>> >> On Sun, Apr 12, 2009 at 1:02 AM, Victorr  wrote:
>>
>> >> > I'm using CakePHP, jQuery and the validation plugin. I'm having some
>> >> > problems. I'm trying to check if a email is already in use but I can't
>> >> > seem to get it too work.
>>
>> >> > I'm just trying to get a error message to see that it works but I
>> >> > can't seem to get it right.
>>
>> >> > Javascript:
>>
>> >> > $(document).ready(function() {
>> >> >        $("#UserIndexForm").validate({
>> >> >                rules: {
>> >> >                        "data[User][email]": {
>> >> >                                required: true,
>> >> >                                email: true,
>> >> >                                remote: "/"
>> >> >                        },
>> >> >                        "data[User][passwrd]": {
>> >> >                                required: true,
>> >> >                                minlength: 5
>> >> >                        },
>> >> >                },
>> >> >                messages: {
>> >> >                        "data[User][email]": {
>> >> >                                required: "Du måste ange en e-post 
>> >> > adress.",
>> >> >                                email: "Du måste ange en giltig e-post 
>> >> > adress.",
>> >> >                                remote: "E-post adressen du angav är 
>> >> > upptagen."
>> >> >                        },
>> >> >                        "data[User][passwrd]": {
>> >> >                                required: "Du måste ange ett lösenord.",
>> >> >                                minlength: "Ditt lösenord måste vara 
>> >> > minst 5 tecken."
>> >> >                        }
>> >> >                }
>> >> >        });
>> >> > });
>>
>> >> > And the controller:
>>
>> >> >                if ($this->RequestHandler->isAjax() && 
>> >> > !empty($_REQUEST['data']
>> >> > ['User']['email'])) {
>> >> >                        $valid = 'false';
>> >> >                        echo $valid;
>> >> >                }
>>
>> >> > Thanks!


[jQuery] Re: Validation plugin remote problem

2009-04-13 Thread Victorr

Sure. I translated the error messages to english so that you would
understand :)
http://betan.midoo.se

On 13 Apr, 16:28, Jörn Zaefferer 
wrote:
> Could you post a testpage? Can't see anything wrong in the snippets
> you provided - its probably something seemingly unrelated.
>
> Jörn
>
> On Sun, Apr 12, 2009 at 4:18 PM, Victorr  wrote:
>
> > Ok. But what do i need too echo to get a false value and an error
> > message?
>
> > thanks!
>
> > On 12 Apr, 10:37, Jörn Zaefferer 
> > wrote:
> >> You need to echo "true" for a valid value.
>
> >> Jörn
>
> >> On Sun, Apr 12, 2009 at 1:02 AM, Victorr  wrote:
>
> >> > I'm using CakePHP, jQuery and the validation plugin. I'm having some
> >> > problems. I'm trying to check if a email is already in use but I can't
> >> > seem to get it too work.
>
> >> > I'm just trying to get a error message to see that it works but I
> >> > can't seem to get it right.
>
> >> > Javascript:
>
> >> > $(document).ready(function() {
> >> >        $("#UserIndexForm").validate({
> >> >                rules: {
> >> >                        "data[User][email]": {
> >> >                                required: true,
> >> >                                email: true,
> >> >                                remote: "/"
> >> >                        },
> >> >                        "data[User][passwrd]": {
> >> >                                required: true,
> >> >                                minlength: 5
> >> >                        },
> >> >                },
> >> >                messages: {
> >> >                        "data[User][email]": {
> >> >                                required: "Du måste ange en e-post 
> >> > adress.",
> >> >                                email: "Du måste ange en giltig e-post 
> >> > adress.",
> >> >                                remote: "E-post adressen du angav är 
> >> > upptagen."
> >> >                        },
> >> >                        "data[User][passwrd]": {
> >> >                                required: "Du måste ange ett lösenord.",
> >> >                                minlength: "Ditt lösenord måste vara 
> >> > minst 5 tecken."
> >> >                        }
> >> >                }
> >> >        });
> >> > });
>
> >> > And the controller:
>
> >> >                if ($this->RequestHandler->isAjax() && 
> >> > !empty($_REQUEST['data']
> >> > ['User']['email'])) {
> >> >                        $valid = 'false';
> >> >                        echo $valid;
> >> >                }
>
> >> > Thanks!


[jQuery] Re: Validation plugin remote problem

2009-04-13 Thread Jörn Zaefferer
Could you post a testpage? Can't see anything wrong in the snippets
you provided - its probably something seemingly unrelated.

Jörn

On Sun, Apr 12, 2009 at 4:18 PM, Victorr  wrote:
>
> Ok. But what do i need too echo to get a false value and an error
> message?
>
> thanks!
>
> On 12 Apr, 10:37, Jörn Zaefferer 
> wrote:
>> You need to echo "true" for a valid value.
>>
>> Jörn
>>
>> On Sun, Apr 12, 2009 at 1:02 AM, Victorr  wrote:
>>
>> > I'm using CakePHP, jQuery and the validation plugin. I'm having some
>> > problems. I'm trying to check if a email is already in use but I can't
>> > seem to get it too work.
>>
>> > I'm just trying to get a error message to see that it works but I
>> > can't seem to get it right.
>>
>> > Javascript:
>>
>> > $(document).ready(function() {
>> >        $("#UserIndexForm").validate({
>> >                rules: {
>> >                        "data[User][email]": {
>> >                                required: true,
>> >                                email: true,
>> >                                remote: "/"
>> >                        },
>> >                        "data[User][passwrd]": {
>> >                                required: true,
>> >                                minlength: 5
>> >                        },
>> >                },
>> >                messages: {
>> >                        "data[User][email]": {
>> >                                required: "Du måste ange en e-post adress.",
>> >                                email: "Du måste ange en giltig e-post 
>> > adress.",
>> >                                remote: "E-post adressen du angav är 
>> > upptagen."
>> >                        },
>> >                        "data[User][passwrd]": {
>> >                                required: "Du måste ange ett lösenord.",
>> >                                minlength: "Ditt lösenord måste vara minst 
>> > 5 tecken."
>> >                        }
>> >                }
>> >        });
>> > });
>>
>> > And the controller:
>>
>> >                if ($this->RequestHandler->isAjax() && 
>> > !empty($_REQUEST['data']
>> > ['User']['email'])) {
>> >                        $valid = 'false';
>> >                        echo $valid;
>> >                }
>>
>> > Thanks!


[jQuery] Re: Validation plugin remote problem

2009-04-12 Thread Victorr

Ok. But what do i need too echo to get a false value and an error
message?

thanks!

On 12 Apr, 10:37, Jörn Zaefferer 
wrote:
> You need to echo "true" for a valid value.
>
> Jörn
>
> On Sun, Apr 12, 2009 at 1:02 AM, Victorr  wrote:
>
> > I'm using CakePHP, jQuery and the validation plugin. I'm having some
> > problems. I'm trying to check if a email is already in use but I can't
> > seem to get it too work.
>
> > I'm just trying to get a error message to see that it works but I
> > can't seem to get it right.
>
> > Javascript:
>
> > $(document).ready(function() {
> >        $("#UserIndexForm").validate({
> >                rules: {
> >                        "data[User][email]": {
> >                                required: true,
> >                                email: true,
> >                                remote: "/"
> >                        },
> >                        "data[User][passwrd]": {
> >                                required: true,
> >                                minlength: 5
> >                        },
> >                },
> >                messages: {
> >                        "data[User][email]": {
> >                                required: "Du måste ange en e-post adress.",
> >                                email: "Du måste ange en giltig e-post 
> > adress.",
> >                                remote: "E-post adressen du angav är 
> > upptagen."
> >                        },
> >                        "data[User][passwrd]": {
> >                                required: "Du måste ange ett lösenord.",
> >                                minlength: "Ditt lösenord måste vara minst 5 
> > tecken."
> >                        }
> >                }
> >        });
> > });
>
> > And the controller:
>
> >                if ($this->RequestHandler->isAjax() && 
> > !empty($_REQUEST['data']
> > ['User']['email'])) {
> >                        $valid = 'false';
> >                        echo $valid;
> >                }
>
> > Thanks!


[jQuery] Re: Validation plugin remote problem

2009-04-12 Thread Jörn Zaefferer
You need to echo "true" for a valid value.

Jörn

On Sun, Apr 12, 2009 at 1:02 AM, Victorr  wrote:
>
> I'm using CakePHP, jQuery and the validation plugin. I'm having some
> problems. I'm trying to check if a email is already in use but I can't
> seem to get it too work.
>
> I'm just trying to get a error message to see that it works but I
> can't seem to get it right.
>
> Javascript:
>
> $(document).ready(function() {
>        $("#UserIndexForm").validate({
>                rules: {
>                        "data[User][email]": {
>                                required: true,
>                                email: true,
>                                remote: "/"
>                        },
>                        "data[User][passwrd]": {
>                                required: true,
>                                minlength: 5
>                        },
>                },
>                messages: {
>                        "data[User][email]": {
>                                required: "Du måste ange en e-post adress.",
>                                email: "Du måste ange en giltig e-post 
> adress.",
>                                remote: "E-post adressen du angav är upptagen."
>                        },
>                        "data[User][passwrd]": {
>                                required: "Du måste ange ett lösenord.",
>                                minlength: "Ditt lösenord måste vara minst 5 
> tecken."
>                        }
>                }
>        });
> });
>
> And the controller:
>
>                if ($this->RequestHandler->isAjax() && !empty($_REQUEST['data']
> ['User']['email'])) {
>                        $valid = 'false';
>                        echo $valid;
>                }
>
>
> Thanks!


[jQuery] Re: Validation plugin: combine functions with strings on remote error

2009-03-24 Thread Andy Matthews

Man, you thought of everything. Thank you. 

-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of Jörn Zaefferer
Sent: Tuesday, March 24, 2009 10:42 AM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Validation plugin: combine functions with strings on
remote error


You shouldn't then use the message-callback for this functionality.
Take a look at the highlight-option instead.

Jörn

On Tue, Mar 24, 2009 at 3:35 PM, Andy Matthews 
wrote:
> Okay...
>
> Another question. I'm having an odd issue with the message area of the 
> plugin, specifically with remote methods. When the remove method 
> fires, as in my original post. The problem is that I want to do some 
> additional error display when the error fires. Problem is that the 
> message key appears to be getting triggered whether there's an error fired
or not.
>
> For example, I'm checking to see if a key exists in the database. If 
> it does, the message should be displayed, AND  the fom field 
> containing the key should have it's background color changed. The 
> problem is that the background color changes whether the msg is 
> displayed or not. Is this a bug, or intended behaviour?
>
> Here's my code to this point.
>
> messages: {
>     pagealias: {
>     required: 'Page alias is required',
>     remote: function(){
>     // also highlight the field containing the error
>     $field.pulse({
>     backgroundColors: ['#fff','#ea7f1e']
>     }).bind('focus', function(){
>     $(this).recover();
>     });
>     return 'This page alias is already in use';
>     }
>     }
> }
>
>
> andy
> 
> From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] 
> On Behalf Of Jörn Zaefferer
> Sent: Monday, March 23, 2009 5:34 PM
> To: jquery-en@googlegroups.com
> Subject: [jQuery] Re: Validation plugin: combine functions with 
> strings on remote error
>
> Passing a function as a message happens all the time when using 
> $.format("... {0}") as messages. The function is expected to return 
> the formated message, so you can just return the string value you want 
> to display at the end of your function.
>
> Jörn
>
> On Mon, Mar 23, 2009 at 10:39 PM, Andy Matthews 
> 
> wrote:
>>
>> I'm using the validation plugin to validate a field remotely. The 
>> validation portion works great, but I've got a question about the 
>> error message if the validation fails.
>>
>> I discovered that you can pass a function rather than a plain string 
>> as seen below in the remote key. The problem is that when I do this, 
>> I lose the ability to display a string of my choosing. Does anyone 
>> know how to accomplish both?
>>
>> messages: {
>>        pagealias: {
>>                required: 'Page alias is required',
>>                remote: function(){
>>                        // highlight the field
>>                        $field.pulse();
>>                        // display message
>>                        'This page alias is already in use'
>>                }
>>        }
>> }
>>
>>
>> Andy Matthews
>> Senior Web Developer
>>
>> www.dealerskins.com
>>
>> P Please consider the environment before printing this e-mail.
>>
>> Total customer satisfaction is my number 1 priority! If you are not 
>> completely satisfied with the service I have provided, please let me 
>> know right away so I can correct the problem, or notify my manager 
>> Aaron West at aw...@dealerskins.com.
>>
>
>




[jQuery] Re: Validation plugin: combine functions with strings on remote error

2009-03-24 Thread Jörn Zaefferer

You shouldn't then use the message-callback for this functionality.
Take a look at the highlight-option instead.

Jörn

On Tue, Mar 24, 2009 at 3:35 PM, Andy Matthews  wrote:
> Okay...
>
> Another question. I'm having an odd issue with the message area of the
> plugin, specifically with remote methods. When the remove method fires, as
> in my original post. The problem is that I want to do some additional error
> display when the error fires. Problem is that the message key appears to be
> getting triggered whether there's an error fired or not.
>
> For example, I'm checking to see if a key exists in the database. If it
> does, the message should be displayed, AND  the fom field containing the key
> should have it's background color changed. The problem is that the
> background color changes whether the msg is displayed or not. Is this a bug,
> or intended behaviour?
>
> Here's my code to this point.
>
> messages: {
>     pagealias: {
>     required: 'Page alias is required',
>     remote: function(){
>     // also highlight the field containing the error
>     $field.pulse({
>     backgroundColors: ['#fff','#ea7f1e']
>     }).bind('focus', function(){
>     $(this).recover();
>     });
>     return 'This page alias is already in use';
>     }
>     }
> }
>
>
> andy
> 
> From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
> Behalf Of Jörn Zaefferer
> Sent: Monday, March 23, 2009 5:34 PM
> To: jquery-en@googlegroups.com
> Subject: [jQuery] Re: Validation plugin: combine functions with strings on
> remote error
>
> Passing a function as a message happens all the time when using
> $.format("... {0}") as messages. The function is expected to return the
> formated message, so you can just return the string value you want to
> display at the end of your function.
>
> Jörn
>
> On Mon, Mar 23, 2009 at 10:39 PM, Andy Matthews 
> wrote:
>>
>> I'm using the validation plugin to validate a field remotely. The
>> validation
>> portion works great, but I've got a question about the error message if
>> the
>> validation fails.
>>
>> I discovered that you can pass a function rather than a plain string as
>> seen
>> below in the remote key. The problem is that when I do this, I lose the
>> ability to display a string of my choosing. Does anyone know how to
>> accomplish both?
>>
>> messages: {
>>        pagealias: {
>>                required: 'Page alias is required',
>>                remote: function(){
>>                        // highlight the field
>>                        $field.pulse();
>>                        // display message
>>                        'This page alias is already in use'
>>                }
>>        }
>> }
>>
>>
>> Andy Matthews
>> Senior Web Developer
>>
>> www.dealerskins.com
>>
>> P Please consider the environment before printing this e-mail.
>>
>> Total customer satisfaction is my number 1 priority! If you are not
>> completely satisfied with
>> the service I have provided, please let me know right away so I can
>> correct
>> the problem,
>> or notify my manager Aaron West at aw...@dealerskins.com.
>>
>
>


[jQuery] Re: Validation plugin: combine functions with strings on remote error

2009-03-24 Thread Andy Matthews
Okay...
 
Another question. I'm having an odd issue with the message area of the
plugin, specifically with remote methods. When the remove method fires, as
in my original post. The problem is that I want to do some additional error
display when the error fires. Problem is that the message key appears to be
getting triggered whether there's an error fired or not.
 
For example, I'm checking to see if a key exists in the database. If it
does, the message should be displayed, AND  the fom field containing the key
should have it's background color changed. The problem is that the
background color changes whether the msg is displayed or not. Is this a bug,
or intended behaviour? 
 
Here's my code to this point.
 
messages: {
pagealias: {
required: 'Page alias is required',
remote: function(){
// also highlight the field containing the error
$field.pulse({
backgroundColors: ['#fff','#ea7f1e']
}).bind('focus', function(){
$(this).recover();
});
return 'This page alias is already in use';
}
}
}
 
 
andy

  _  

From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of Jörn Zaefferer
Sent: Monday, March 23, 2009 5:34 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Validation plugin: combine functions with strings on
remote error


Passing a function as a message happens all the time when using
$.format("... {0}") as messages. The function is expected to return the
formated message, so you can just return the string value you want to
display at the end of your function.

Jörn


On Mon, Mar 23, 2009 at 10:39 PM, Andy Matthews 
wrote:



I'm using the validation plugin to validate a field remotely. The validation
portion works great, but I've got a question about the error message if the
validation fails.

I discovered that you can pass a function rather than a plain string as seen
below in the remote key. The problem is that when I do this, I lose the
ability to display a string of my choosing. Does anyone know how to
accomplish both?

messages: {
   pagealias: {
   required: 'Page alias is required',
   remote: function(){
   // highlight the field
   $field.pulse();
   // display message
   'This page alias is already in use'
   }
   }
}


Andy Matthews
Senior Web Developer

www.dealerskins.com

P Please consider the environment before printing this e-mail.

Total customer satisfaction is my number 1 priority! If you are not
completely satisfied with
the service I have provided, please let me know right away so I can correct
the problem,
or notify my manager Aaron West at aw...@dealerskins.com.






[jQuery] Re: Validation plugin: combine functions with strings on remote error

2009-03-24 Thread Andy Matthews
Woohoo! That was easy enough. Thanks a ton for this amazing plugin. I'm sad
that this is the first time I've used it.

  _  

From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of Jörn Zaefferer
Sent: Monday, March 23, 2009 5:34 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Validation plugin: combine functions with strings on
remote error


Passing a function as a message happens all the time when using
$.format("... {0}") as messages. The function is expected to return the
formated message, so you can just return the string value you want to
display at the end of your function.

Jörn


On Mon, Mar 23, 2009 at 10:39 PM, Andy Matthews 
wrote:



I'm using the validation plugin to validate a field remotely. The validation
portion works great, but I've got a question about the error message if the
validation fails.

I discovered that you can pass a function rather than a plain string as seen
below in the remote key. The problem is that when I do this, I lose the
ability to display a string of my choosing. Does anyone know how to
accomplish both?

messages: {
   pagealias: {
   required: 'Page alias is required',
   remote: function(){
   // highlight the field
   $field.pulse();
   // display message
   'This page alias is already in use'
   }
   }
}


Andy Matthews
Senior Web Developer

www.dealerskins.com

P Please consider the environment before printing this e-mail.

Total customer satisfaction is my number 1 priority! If you are not
completely satisfied with
the service I have provided, please let me know right away so I can correct
the problem,
or notify my manager Aaron West at aw...@dealerskins.com.






[jQuery] Re: Validation plugin: combine functions with strings on remote error

2009-03-23 Thread Jörn Zaefferer
Passing a function as a message happens all the time when using
$.format("... {0}") as messages. The function is expected to return the
formated message, so you can just return the string value you want to
display at the end of your function.

Jörn

On Mon, Mar 23, 2009 at 10:39 PM, Andy Matthews
wrote:

>
> I'm using the validation plugin to validate a field remotely. The
> validation
> portion works great, but I've got a question about the error message if the
> validation fails.
>
> I discovered that you can pass a function rather than a plain string as
> seen
> below in the remote key. The problem is that when I do this, I lose the
> ability to display a string of my choosing. Does anyone know how to
> accomplish both?
>
> messages: {
>pagealias: {
>required: 'Page alias is required',
>remote: function(){
>// highlight the field
>$field.pulse();
>// display message
>'This page alias is already in use'
>}
>}
> }
>
>
> Andy Matthews
> Senior Web Developer
>
> www.dealerskins.com
>
> P Please consider the environment before printing this e-mail.
>
> Total customer satisfaction is my number 1 priority! If you are not
> completely satisfied with
> the service I have provided, please let me know right away so I can correct
> the problem,
> or notify my manager Aaron West at aw...@dealerskins.com.
>
>


[jQuery] Re: Validation Plugin: Too Much Recursion

2009-02-25 Thread kevinm

Ah ignore. Team member left of method attribute.

On Feb 25, 9:07 am, kevinm  wrote:
> Jörn ,
>
> New issue, that is related.
>
> When I use form.submit() inside the modal window it does not submit
> correctly.
>
> When we did this (before applying validate)
>
> function submitForm() {
>         document.myform.submit();
>          parent.$.nyroModalRemove();  // this closes the modal window
>         return false;
>
> }
>
> our submission from the modal worked.
>
> So for some reason doing the submit from the submit handler is
> different then what we did, or I am just doing things wrong.
>
> Ideally I am trying to avoid have to do a AJAX form submit
> Thanks
> Kevin
>
> On Feb 24, 1:35 pm, Jörn Zaefferer 
> wrote:
>
> > Here's hoping the next one finds 
> > this:http://docs.jquery.com/Plugins/Validation#Too_much_recursion
>
> > Jörn
>
> > On Tue, Feb 24, 2009 at 7:01 PM, kevinm  wrote:
>
> > > Ah, makes total sense. Thanks
>
> > > On Feb 24, 1:01 pm, Jörn Zaefferer 
> > > wrote:
> > >> $(form).submit() triggers another round of validation, resulting in
> > >> another call to submitHandler, and voila,recursion. Replace that with
> > >> form.submit(), which triggers the native submit event instead and not
> > >> the validation.
>
> > >> Jörn
>
> > >> On Tue, Feb 24, 2009 at 4:58 PM, kevinm  wrote:
>
> > >> > James,
>
> > >> > We just ran into the same issue. In my case we are opening a modal
> > >> > window with nyroModal. Here is thevalidatefunction.
>
> > >> > var myValidate = $("#myform").validate({
> > >> >                        ignoreTitle: true,
> > >> >                        focusCleanup: false,
> > >> >                        ignoreTitle: true,
> > >> >                        debug: true,
> > >> >                        onfocusout: false,
> > >> >                        submitHandler: function(form) {
> > >> >                                // do other stuff for a valid form
> > >> >                                $(form).submit();
> > >> >                                parent.$.nyroModalRemove(); return 
> > >> > false;
> > >> >                        },
> > >> >                rules: {
> > >> >                                        with_req_request_date: {
> > >> >                                        required: true,
> > >> >                                        date:true
> > >> >                                        },
> > >> >                                        with_req_request_type: {
> > >> >                                        required: true
> > >> >                                        },
> > >> >                                        withdrawal_reason_id: {
> > >> >                                        required: true
> > >> >                                        },
> > >> >                                        case_note: {
> > >> >                                        required: true
> > >> >                                        }
> > >> >                },
>
> > >> >                messages: {
> > >> >                with_req_request_date: "Please enter the date in proper
> > >> > 'mm/dd/' format",
> > >> >                    with_req_request_type: "Please select the request 
> > >> > type",
> > >> >                                withdrawal_reason_id: "Please select 
> > >> > the withdrawal reason",
> > >> >                                case_note: "Please enter the case note"
> > >> >            }
>
> > >> >                // } )
>
> > >> >                }) //End ofvalidate
>
> > >> > What I did notice if that I do not do the form.submit inside the
> > >> > submit handler therecursiondoes not occur.  Not sure if that helps.
> > >> > Also in this case this is the onlyvalidatecall.
>
> > >> > Kevin
>
> > >> > On Feb 9, 1:19 am, James  wrote:
> > >> >> Since you can't show any code, with only what I see there should not
> > >> >> be any issues...
> > >> >> That is, there is no issue with using twovalidatefunctions on two
> > >> >> different forms, each with it's own set of rules.
>
> > >> >> You're going to have to show more code for us to get to down to the
> > >> >> issue.
>
> > >> >> On Feb 8, 5:54 pm, Cutter  wrote:
>
> > >> >> > I have an odd thing happening with the Validation Plugin (latest 
> > >> >> > build
> > >> >> > on JQuery 1.3). I have several forms setup on a page, with 
> > >> >> > validation
> > >> >> > on two. My first works fine, but my second keeps giving me errors in
> > >> >> > Firebug about 'too muchrecursion'. The configs for these two form
> > >> >> > validations are nearly identical, with the exception of the rules 
> > >> >> > and
> > >> >> > messages, which are very basic field-is-requirewswwd kinda stuff. 
> > >> >> > Some
> > >> >> > searching on the web shows me that there used to be a ticket on this
> > >> >> > (#2995), but that it was closed without fix.
>
> > >> >> > I have stripped down my second form'svalidatemethod (the one that is
> > >> >> > erroring) to the barest of validation scripts, and can not get by it
> > >

[jQuery] Re: Validation Plugin: Too Much Recursion

2009-02-25 Thread kevinm

Jörn ,

New issue, that is related.

When I use form.submit() inside the modal window it does not submit
correctly.

When we did this (before applying validate)

function submitForm() {
document.myform.submit();
 parent.$.nyroModalRemove();  // this closes the modal window
return false;
}

our submission from the modal worked.

So for some reason doing the submit from the submit handler is
different then what we did, or I am just doing things wrong.

Ideally I am trying to avoid have to do a AJAX form submit
Thanks
Kevin

On Feb 24, 1:35 pm, Jörn Zaefferer 
wrote:
> Here's hoping the next one finds 
> this:http://docs.jquery.com/Plugins/Validation#Too_much_recursion
>
> Jörn
>
> On Tue, Feb 24, 2009 at 7:01 PM, kevinm  wrote:
>
> > Ah, makes total sense. Thanks
>
> > On Feb 24, 1:01 pm, Jörn Zaefferer 
> > wrote:
> >> $(form).submit() triggers another round of validation, resulting in
> >> another call to submitHandler, and voila,recursion. Replace that with
> >> form.submit(), which triggers the native submit event instead and not
> >> the validation.
>
> >> Jörn
>
> >> On Tue, Feb 24, 2009 at 4:58 PM, kevinm  wrote:
>
> >> > James,
>
> >> > We just ran into the same issue. In my case we are opening a modal
> >> > window with nyroModal. Here is thevalidatefunction.
>
> >> > var myValidate = $("#myform").validate({
> >> >                        ignoreTitle: true,
> >> >                        focusCleanup: false,
> >> >                        ignoreTitle: true,
> >> >                        debug: true,
> >> >                        onfocusout: false,
> >> >                        submitHandler: function(form) {
> >> >                                // do other stuff for a valid form
> >> >                                $(form).submit();
> >> >                                parent.$.nyroModalRemove(); return false;
> >> >                        },
> >> >                rules: {
> >> >                                        with_req_request_date: {
> >> >                                        required: true,
> >> >                                        date:true
> >> >                                        },
> >> >                                        with_req_request_type: {
> >> >                                        required: true
> >> >                                        },
> >> >                                        withdrawal_reason_id: {
> >> >                                        required: true
> >> >                                        },
> >> >                                        case_note: {
> >> >                                        required: true
> >> >                                        }
> >> >                },
>
> >> >                messages: {
> >> >                with_req_request_date: "Please enter the date in proper
> >> > 'mm/dd/' format",
> >> >                    with_req_request_type: "Please select the request 
> >> > type",
> >> >                                withdrawal_reason_id: "Please select the 
> >> > withdrawal reason",
> >> >                                case_note: "Please enter the case note"
> >> >            }
>
> >> >                // } )
>
> >> >                }) //End ofvalidate
>
> >> > What I did notice if that I do not do the form.submit inside the
> >> > submit handler therecursiondoes not occur.  Not sure if that helps.
> >> > Also in this case this is the onlyvalidatecall.
>
> >> > Kevin
>
> >> > On Feb 9, 1:19 am, James  wrote:
> >> >> Since you can't show any code, with only what I see there should not
> >> >> be any issues...
> >> >> That is, there is no issue with using twovalidatefunctions on two
> >> >> different forms, each with it's own set of rules.
>
> >> >> You're going to have to show more code for us to get to down to the
> >> >> issue.
>
> >> >> On Feb 8, 5:54 pm, Cutter  wrote:
>
> >> >> > I have an odd thing happening with the Validation Plugin (latest build
> >> >> > on JQuery 1.3). I have several forms setup on a page, with validation
> >> >> > on two. My first works fine, but my second keeps giving me errors in
> >> >> > Firebug about 'too muchrecursion'. The configs for these two form
> >> >> > validations are nearly identical, with the exception of the rules and
> >> >> > messages, which are very basic field-is-requirewswwd kinda stuff. Some
> >> >> > searching on the web shows me that there used to be a ticket on this
> >> >> > (#2995), but that it was closed without fix.
>
> >> >> > I have stripped down my second form'svalidatemethod (the one that is
> >> >> > erroring) to the barest of validation scripts, and can not get by it
> >> >> > for the life of me. The configs each set avalidate() method on a
> >> >> > separate form.
>
> >> >> > $('#frm1').validate({
> >> >> >    // config here
>
> >> >> > }
>
> >> >> > $('#frm2').validate({
> >> >> >     // second config here
>
> >> >> > }
>
> >> >> > I am getting nowhere. Anyone?
>
> >> >> > (BTW, I can't post the code, or show

[jQuery] Re: Validation Plugin: Too Much Recursion

2009-02-24 Thread Jörn Zaefferer
Here's hoping the next one finds this:
http://docs.jquery.com/Plugins/Validation#Too_much_recursion

Jörn

On Tue, Feb 24, 2009 at 7:01 PM, kevinm  wrote:
>
> Ah, makes total sense. Thanks
>
> On Feb 24, 1:01 pm, Jörn Zaefferer 
> wrote:
>> $(form).submit() triggers another round of validation, resulting in
>> another call to submitHandler, and voila,recursion. Replace that with
>> form.submit(), which triggers the native submit event instead and not
>> the validation.
>>
>> Jörn
>>
>> On Tue, Feb 24, 2009 at 4:58 PM, kevinm  wrote:
>>
>> > James,
>>
>> > We just ran into the same issue. In my case we are opening a modal
>> > window with nyroModal. Here is thevalidatefunction.
>>
>> > var myValidate = $("#myform").validate({
>> >                        ignoreTitle: true,
>> >                        focusCleanup: false,
>> >                        ignoreTitle: true,
>> >                        debug: true,
>> >                        onfocusout: false,
>> >                        submitHandler: function(form) {
>> >                                // do other stuff for a valid form
>> >                                $(form).submit();
>> >                                parent.$.nyroModalRemove(); return false;
>> >                        },
>> >                rules: {
>> >                                        with_req_request_date: {
>> >                                        required: true,
>> >                                        date:true
>> >                                        },
>> >                                        with_req_request_type: {
>> >                                        required: true
>> >                                        },
>> >                                        withdrawal_reason_id: {
>> >                                        required: true
>> >                                        },
>> >                                        case_note: {
>> >                                        required: true
>> >                                        }
>> >                },
>>
>> >                messages: {
>> >                with_req_request_date: "Please enter the date in proper
>> > 'mm/dd/' format",
>> >                    with_req_request_type: "Please select the request type",
>> >                                withdrawal_reason_id: "Please select the 
>> > withdrawal reason",
>> >                                case_note: "Please enter the case note"
>> >            }
>>
>> >                // } )
>>
>> >                }) //End ofvalidate
>>
>> > What I did notice if that I do not do the form.submit inside the
>> > submit handler therecursiondoes not occur.  Not sure if that helps.
>> > Also in this case this is the onlyvalidatecall.
>>
>> > Kevin
>>
>> > On Feb 9, 1:19 am, James  wrote:
>> >> Since you can't show any code, with only what I see there should not
>> >> be any issues...
>> >> That is, there is no issue with using twovalidatefunctions on two
>> >> different forms, each with it's own set of rules.
>>
>> >> You're going to have to show more code for us to get to down to the
>> >> issue.
>>
>> >> On Feb 8, 5:54 pm, Cutter  wrote:
>>
>> >> > I have an odd thing happening with the Validation Plugin (latest build
>> >> > on JQuery 1.3). I have several forms setup on a page, with validation
>> >> > on two. My first works fine, but my second keeps giving me errors in
>> >> > Firebug about 'too muchrecursion'. The configs for these two form
>> >> > validations are nearly identical, with the exception of the rules and
>> >> > messages, which are very basic field-is-requirewswwd kinda stuff. Some
>> >> > searching on the web shows me that there used to be a ticket on this
>> >> > (#2995), but that it was closed without fix.
>>
>> >> > I have stripped down my second form'svalidatemethod (the one that is
>> >> > erroring) to the barest of validation scripts, and can not get by it
>> >> > for the life of me. The configs each set avalidate() method on a
>> >> > separate form.
>>
>> >> > $('#frm1').validate({
>> >> >    // config here
>>
>> >> > }
>>
>> >> > $('#frm2').validate({
>> >> >     // second config here
>>
>> >> > }
>>
>> >> > I am getting nowhere. Anyone?
>>
>> >> > (BTW, I can't post the code, or show you a form, because it's all
>> >> > behind the firewall)


[jQuery] Re: Validation Plugin: Too Much Recursion

2009-02-24 Thread kevinm

Ah, makes total sense. Thanks

On Feb 24, 1:01 pm, Jörn Zaefferer 
wrote:
> $(form).submit() triggers another round of validation, resulting in
> another call to submitHandler, and voila,recursion. Replace that with
> form.submit(), which triggers the native submit event instead and not
> the validation.
>
> Jörn
>
> On Tue, Feb 24, 2009 at 4:58 PM, kevinm  wrote:
>
> > James,
>
> > We just ran into the same issue. In my case we are opening a modal
> > window with nyroModal. Here is thevalidatefunction.
>
> > var myValidate = $("#myform").validate({
> >                        ignoreTitle: true,
> >                        focusCleanup: false,
> >                        ignoreTitle: true,
> >                        debug: true,
> >                        onfocusout: false,
> >                        submitHandler: function(form) {
> >                                // do other stuff for a valid form
> >                                $(form).submit();
> >                                parent.$.nyroModalRemove(); return false;
> >                        },
> >                rules: {
> >                                        with_req_request_date: {
> >                                        required: true,
> >                                        date:true
> >                                        },
> >                                        with_req_request_type: {
> >                                        required: true
> >                                        },
> >                                        withdrawal_reason_id: {
> >                                        required: true
> >                                        },
> >                                        case_note: {
> >                                        required: true
> >                                        }
> >                },
>
> >                messages: {
> >                with_req_request_date: "Please enter the date in proper
> > 'mm/dd/' format",
> >                    with_req_request_type: "Please select the request type",
> >                                withdrawal_reason_id: "Please select the 
> > withdrawal reason",
> >                                case_note: "Please enter the case note"
> >            }
>
> >                // } )
>
> >                }) //End ofvalidate
>
> > What I did notice if that I do not do the form.submit inside the
> > submit handler therecursiondoes not occur.  Not sure if that helps.
> > Also in this case this is the onlyvalidatecall.
>
> > Kevin
>
> > On Feb 9, 1:19 am, James  wrote:
> >> Since you can't show any code, with only what I see there should not
> >> be any issues...
> >> That is, there is no issue with using twovalidatefunctions on two
> >> different forms, each with it's own set of rules.
>
> >> You're going to have to show more code for us to get to down to the
> >> issue.
>
> >> On Feb 8, 5:54 pm, Cutter  wrote:
>
> >> > I have an odd thing happening with the Validation Plugin (latest build
> >> > on JQuery 1.3). I have several forms setup on a page, with validation
> >> > on two. My first works fine, but my second keeps giving me errors in
> >> > Firebug about 'too muchrecursion'. The configs for these two form
> >> > validations are nearly identical, with the exception of the rules and
> >> > messages, which are very basic field-is-requirewswwd kinda stuff. Some
> >> > searching on the web shows me that there used to be a ticket on this
> >> > (#2995), but that it was closed without fix.
>
> >> > I have stripped down my second form'svalidatemethod (the one that is
> >> > erroring) to the barest of validation scripts, and can not get by it
> >> > for the life of me. The configs each set avalidate() method on a
> >> > separate form.
>
> >> > $('#frm1').validate({
> >> >    // config here
>
> >> > }
>
> >> > $('#frm2').validate({
> >> >     // second config here
>
> >> > }
>
> >> > I am getting nowhere. Anyone?
>
> >> > (BTW, I can't post the code, or show you a form, because it's all
> >> > behind the firewall)


[jQuery] Re: Validation Plugin: Too Much Recursion

2009-02-24 Thread Jörn Zaefferer
$(form).submit() triggers another round of validation, resulting in
another call to submitHandler, and voila, recursion. Replace that with
form.submit(), which triggers the native submit event instead and not
the validation.

Jörn

On Tue, Feb 24, 2009 at 4:58 PM, kevinm  wrote:
>
> James,
>
> We just ran into the same issue. In my case we are opening a modal
> window with nyroModal. Here is the validate function.
>
> var myValidate = $("#myform").validate({
>                        ignoreTitle: true,
>                        focusCleanup: false,
>                        ignoreTitle: true,
>                        debug: true,
>                        onfocusout: false,
>                        submitHandler: function(form) {
>                                // do other stuff for a valid form
>                                $(form).submit();
>                                parent.$.nyroModalRemove(); return false;
>                        },
>                rules: {
>                                        with_req_request_date: {
>                                        required: true,
>                                        date:true
>                                        },
>                                        with_req_request_type: {
>                                        required: true
>                                        },
>                                        withdrawal_reason_id: {
>                                        required: true
>                                        },
>                                        case_note: {
>                                        required: true
>                                        }
>                },
>
>                messages: {
>                with_req_request_date: "Please enter the date in proper
> 'mm/dd/' format",
>                    with_req_request_type: "Please select the request type",
>                                withdrawal_reason_id: "Please select the 
> withdrawal reason",
>                                case_note: "Please enter the case note"
>            }
>
>                // } )
>
>                }) //End of validate
>
> What I did notice if that I do not do the form.submit inside the
> submit handler the recursion does not occur.  Not sure if that helps.
> Also in this case this is the only validate call.
>
> Kevin
>
> On Feb 9, 1:19 am, James  wrote:
>> Since you can't show any code, with only what I see there should not
>> be any issues...
>> That is, there is no issue with using twovalidatefunctions on two
>> different forms, each with it's own set of rules.
>>
>> You're going to have to show more code for us to get to down to the
>> issue.
>>
>> On Feb 8, 5:54 pm, Cutter  wrote:
>>
>> > I have an odd thing happening with the Validation Plugin (latest build
>> > on JQuery 1.3). I have several forms setup on a page, with validation
>> > on two. My first works fine, but my second keeps giving me errors in
>> > Firebug about 'too muchrecursion'. The configs for these two form
>> > validations are nearly identical, with the exception of the rules and
>> > messages, which are very basic field-is-requirewswwd kinda stuff. Some
>> > searching on the web shows me that there used to be a ticket on this
>> > (#2995), but that it was closed without fix.
>>
>> > I have stripped down my second form'svalidatemethod (the one that is
>> > erroring) to the barest of validation scripts, and can not get by it
>> > for the life of me. The configs each set avalidate() method on a
>> > separate form.
>>
>> > $('#frm1').validate({
>> >    // config here
>>
>> > }
>>
>> > $('#frm2').validate({
>> >     // second config here
>>
>> > }
>>
>> > I am getting nowhere. Anyone?
>>
>> > (BTW, I can't post the code, or show you a form, because it's all
>> > behind the firewall)


[jQuery] Re: Validation Plugin: Too Much Recursion

2009-02-24 Thread kevinm

James,

We just ran into the same issue. In my case we are opening a modal
window with nyroModal. Here is the validate function.

var myValidate = $("#myform").validate({
ignoreTitle: true,
focusCleanup: false,
ignoreTitle: true,
debug: true,
onfocusout: false,
submitHandler: function(form) {
// do other stuff for a valid form
$(form).submit();
parent.$.nyroModalRemove(); return false;
},
rules: {
with_req_request_date: {
required: true,
date:true
},
with_req_request_type: {
required: true
},
withdrawal_reason_id: {
required: true
},
case_note: {
required: true
}
},

messages: {
with_req_request_date: "Please enter the date in proper
'mm/dd/' format",
with_req_request_type: "Please select the request type",
withdrawal_reason_id: "Please select the 
withdrawal reason",
case_note: "Please enter the case note"
}

// } )

}) //End of validate

What I did notice if that I do not do the form.submit inside the
submit handler the recursion does not occur.  Not sure if that helps.
Also in this case this is the only validate call.

Kevin

On Feb 9, 1:19 am, James  wrote:
> Since you can't show any code, with only what I see there should not
> be any issues...
> That is, there is no issue with using twovalidatefunctions on two
> different forms, each with it's own set of rules.
>
> You're going to have to show more code for us to get to down to the
> issue.
>
> On Feb 8, 5:54 pm, Cutter  wrote:
>
> > I have an odd thing happening with the Validation Plugin (latest build
> > on JQuery 1.3). I have several forms setup on a page, with validation
> > on two. My first works fine, but my second keeps giving me errors in
> > Firebug about 'too muchrecursion'. The configs for these two form
> > validations are nearly identical, with the exception of the rules and
> > messages, which are very basic field-is-requirewswwd kinda stuff. Some
> > searching on the web shows me that there used to be a ticket on this
> > (#2995), but that it was closed without fix.
>
> > I have stripped down my second form'svalidatemethod (the one that is
> > erroring) to the barest of validation scripts, and can not get by it
> > for the life of me. The configs each set avalidate() method on a
> > separate form.
>
> > $('#frm1').validate({
> >    // config here
>
> > }
>
> > $('#frm2').validate({
> >     // second config here
>
> > }
>
> > I am getting nowhere. Anyone?
>
> > (BTW, I can't post the code, or show you a form, because it's all
> > behind the firewall)


[jQuery] Re: Validation Plugin: How to submit invalid form via JavaScript

2009-02-18 Thread Michael Lawson
If you're trying to submit the form even if it doesn't validate...then why
validate in the first place? i'm confused
cheers

Michael Lawson
Content Tools Developer, Global Solutions, ibm.com
Phone:  1-919-517-1568 Tieline:  255-1568
E-mail:  mjlaw...@us.ibm.com

'Examine my teachings critically, as a gold assayer would test gold. If you
find they make sense, conform to your experience, and don't harm yourself
or others, only then should you accept them.'



 
  From:   shmolch 
 

 
  To: "jQuery (English)"
 

 
  Date:   02/18/2009 09:26 AM   
 

 
  Subject:[jQuery] Validation Plugin: How to submit invalid form via 
JavaScript  

 






Hi,

I want to validate form and submit it via JavaScript even if it isn't
valid, and don't do it if the "submit" button is pressed

$(document).ready(function() {
  validator = $("#editUserForm").validate(
{
focusInvalid: false,
ignoreTitle: true,
onkeyup: false
});
  ...
});

And then I'm trying to submit form after onclick on some control

$("#someControl").click(function() {
   // do something
$("#filterForm").submit();
});

Unfortunately, form doesn't via JS submit if validation failed

<><>

[jQuery] Re: Validation Plugin: Too Much Recursion

2009-02-08 Thread James

Since you can't show any code, with only what I see there should not
be any issues...
That is, there is no issue with using two validate functions on two
different forms, each with it's own set of rules.

You're going to have to show more code for us to get to down to the
issue.

On Feb 8, 5:54 pm, Cutter  wrote:
> I have an odd thing happening with the Validation Plugin (latest build
> on JQuery 1.3). I have several forms setup on a page, with validation
> on two. My first works fine, but my second keeps giving me errors in
> Firebug about 'too much recursion'. The configs for these two form
> validations are nearly identical, with the exception of the rules and
> messages, which are very basic field-is-requirewswwd kinda stuff. Some
> searching on the web shows me that there used to be a ticket on this
> (#2995), but that it was closed without fix.
>
> I have stripped down my second form's validate method (the one that is
> erroring) to the barest of validation scripts, and can not get by it
> for the life of me. The configs each set a validate() method on a
> separate form.
>
> $('#frm1').validate({
>    // config here
>
> }
>
> $('#frm2').validate({
>     // second config here
>
> }
>
> I am getting nowhere. Anyone?
>
> (BTW, I can't post the code, or show you a form, because it's all
> behind the firewall)


[jQuery] Re: validation plugin: validate checkboxes that don't have same name?

2009-02-06 Thread jQuery Lover

You can add custom rule with your custom validator. Read documentation
here: http://docs.jquery.com/Plugins/Validation


Read jQuery HowTo Resource  -  http://jquery-howto.blogspot.com



On Fri, Feb 6, 2009 at 7:22 AM, claudes  wrote:
>
>
> using validation plugin, is there a way to validate checkbox group that has
> different name attributes? i would like to make sure that at least one
> checkbox has been selected but i'm not sure how to do it because they all
> have different names.
>
> thanks
> --
> View this message in context: 
> http://www.nabble.com/validation-plugin%3A-validate-checkboxes-that-don%27t-have-same-name--tp21865439s27240p21865439.html
> Sent from the jQuery General Discussion mailing list archive at Nabble.com.
>
>


[jQuery] Re: Validation Plugin

2009-02-05 Thread tres

You can with my form validation plugin.

http://shugartweb.com/jquery/form

There is an option that you can pass called 'ignore'. It is a selector
for all fields that should be ignored in validation. By default it is
':hidden', but you can put anything in there such as ':hidden,
[value="default value"], .example-field'. It will then ignore those on
validation.

If you have any questions, changes, suggestions, comments or just
would like to collaborate, let me know.

Trey




On Feb 5, 6:56 am, varun  wrote:
> Hi
>
> Can some one please tell me if I can use validate plugin if saomething
> is written in textbox by default ?
>
> I have a textbox which is using auto complete p[lugin , so when page
> loads an "auto-suggest" keyword always written in textbox and if some
> user clicks that keyword,it disappears ...
> I want even if it is there and somebody submits the form , validation
> plugin should work?
>
> Thanks
> Varun


[jQuery] Re: validation plugin and ui tabs

2009-02-04 Thread Varun Khatri
I was checking it on the link that you sent me , so do you think I need it
to have form tag seperately in each tab ... and then use it or I can just
use aspnetForm...


The problem is how in each tab i will have different validation ... Like
tab1 will have textbox1 and submitbutton1...tab2 will have textbox2 and
submitbutton2 and so on...

now if I press submnitbutton1 .. it should only validate textbox1 aqnd if i
click submitbutton2 it should only validate textbox2

another problem... suppose in any of textbox I am using autocomplete plugin
and when page loads ... "Auto-Suggest "
 keyword is written in textbox in that case validation fails as it looks
for empty textbox  is there any work around for that ?


can you write a small some pseudo code for that ?

thanks
varun

On Wed, Feb 4, 2009 at 2:55 PM, tres  wrote:

>
> It is being used and is stable in an enterprise environment so I
> shouldn't say "alpha". The only reason I said that was because I do
> want to do a lot more work to it and the api might change.
>
> Trey
>
>
>
> On Feb 5, 9:42 am, tres  wrote:
> > Varun,
> >
> > I've actually solved a problem like this for the company that I work
> > for. I have 5 tabs, all located within 1 form. I also had to label the
> > tabs that had errors and focus the first one that had errors. This is
> > simply unachievable without a bit of "hacking" with the .validate()
> > plugin. Don't get me wrong, it's a great plugin, but doesn't scale
> > very well when posed with a very high level problem, not to mention it
> > can get slow when validating a lot of fields. Because of this, I have
> > written something for myself that may be of use to you. It is still in
> > "alpha stages" and I have a lot of changes and fixes that I want to
> > work on, but it is quite effective and it may help you quite bit with
> > your problem here.
> >
> > http://shugartweb.com/jquery/form/
> >
> > The documentation is generated from the doc blocks in the code, so
> > it's fairly well documented, but lacking examples. Let me know if you
> > like it.
> >
> > Suggestions, changes, collaboration is all welcome.
> >
> > Cheers,
> > Trey
> >
> > On Feb 4, 11:12 am, varun  wrote:
> >
> > > Hi Everybody
> >
> > > I am trying to use validation plugin with ui tbas.
> >
> > > suppose I have 5 tabs on page and every tab have submit button  in
> > > that case how can I use validation plugin...
> >
> > > I know i can use validation as:
> >
> > > ('#form-id').validate();
> >
> > > but since i have 5 tabs but i cant have 5 forms in asp.net(please
> > > correct me if I am wrong)...
> >
> > > can some one please let me know workaround for this ?
> >
> > > Thanks
> > > Varun
>


[jQuery] Re: validation plugin and ui tabs

2009-02-04 Thread tres

It is being used and is stable in an enterprise environment so I
shouldn't say "alpha". The only reason I said that was because I do
want to do a lot more work to it and the api might change.

Trey



On Feb 5, 9:42 am, tres  wrote:
> Varun,
>
> I've actually solved a problem like this for the company that I work
> for. I have 5 tabs, all located within 1 form. I also had to label the
> tabs that had errors and focus the first one that had errors. This is
> simply unachievable without a bit of "hacking" with the .validate()
> plugin. Don't get me wrong, it's a great plugin, but doesn't scale
> very well when posed with a very high level problem, not to mention it
> can get slow when validating a lot of fields. Because of this, I have
> written something for myself that may be of use to you. It is still in
> "alpha stages" and I have a lot of changes and fixes that I want to
> work on, but it is quite effective and it may help you quite bit with
> your problem here.
>
> http://shugartweb.com/jquery/form/
>
> The documentation is generated from the doc blocks in the code, so
> it's fairly well documented, but lacking examples. Let me know if you
> like it.
>
> Suggestions, changes, collaboration is all welcome.
>
> Cheers,
> Trey
>
> On Feb 4, 11:12 am, varun  wrote:
>
> > Hi Everybody
>
> > I am trying to use validation plugin with ui tbas.
>
> > suppose I have 5 tabs on page and every tab have submit button  in
> > that case how can I use validation plugin...
>
> > I know i can use validation as:
>
> > ('#form-id').validate();
>
> > but since i have 5 tabs but i cant have 5 forms in asp.net(please
> > correct me if I am wrong)...
>
> > can some one please let me know workaround for this ?
>
> > Thanks
> > Varun


[jQuery] Re: validation plugin and ui tabs

2009-02-04 Thread tres

Varun,

I've actually solved a problem like this for the company that I work
for. I have 5 tabs, all located within 1 form. I also had to label the
tabs that had errors and focus the first one that had errors. This is
simply unachievable without a bit of "hacking" with the .validate()
plugin. Don't get me wrong, it's a great plugin, but doesn't scale
very well when posed with a very high level problem, not to mention it
can get slow when validating a lot of fields. Because of this, I have
written something for myself that may be of use to you. It is still in
"alpha stages" and I have a lot of changes and fixes that I want to
work on, but it is quite effective and it may help you quite bit with
your problem here.

http://shugartweb.com/jquery/form/

The documentation is generated from the doc blocks in the code, so
it's fairly well documented, but lacking examples. Let me know if you
like it.

Suggestions, changes, collaboration is all welcome.

Cheers,
Trey



On Feb 4, 11:12 am, varun  wrote:
> Hi Everybody
>
> I am trying to use validation plugin with ui tbas.
>
> suppose I have 5 tabs on page and every tab have submit button  in
> that case how can I use validation plugin...
>
> I know i can use validation as:
>
> ('#form-id').validate();
>
> but since i have 5 tabs but i cant have 5 forms in asp.net(please
> correct me if I am wrong)...
>
> can some one please let me know workaround for this ?
>
> Thanks
> Varun


[jQuery] Re: validation plugin and ui tabs

2009-02-04 Thread Caldur

Well, you can have as many  elements as you want on a page, but
you can only have one  element per page. Not sure
if that will help you any.

On Feb 3, 6:12 pm, varun  wrote:
> Hi Everybody
>
> I am trying to use validation plugin with ui tbas.
>
> suppose I have 5 tabs on page and every tab have submit button  in
> that case how can I use validation plugin...
>
> I know i can use validation as:
>
> ('#form-id').validate();
>
> but since i have 5 tabs but i cant have 5 forms in asp.net(please
> correct me if I am wrong)...
>
> can some one please let me know workaround for this ?
>
> Thanks
> Varun


[jQuery] Re: validation plugin: how to add custom messages for groups

2009-01-30 Thread Mihai Danila


Sorry, the third validator must only get "activated" if both are empty
(in other words, it must return true if either is not empty):

function validateNameInputs(value, element) { return
firstNameInput.value || lastNameInput.value; }

On Jan 30, 11:19 am, Mihai Danila  wrote:
> There was a small typo in validateLastNameInput. Here's the corrected
> code.
>
> 
> 
> jQuery.validator.addMethod('first-name-input', validateFirstNameInput,
> 'First name is missing.');
> jQuery.validator.addMethod('last-name-input', validateLastNameInput,
> 'Last name is missing.');
> jQuery.validator.addMethod('name-input', validateNameInputs, 'First
> and Last name are missing.');
> var firstNameInput = document.getElementById('firstNameInput');
> var lastNameInput = document.getElementById('lastNameInput');
> function validateFirstNameInput(value, element) { return !
> lastNameInput.value || value; }           // 1
> function validateLastNameInput(value, element) { return !
> firstNameInput.value || value; }            // 2
> function validateNameInputs(value, element) { return
> firstNameInput.value && lastNameInput.value; } // 3
>
> On Jan 30, 11:18 am, Mihai Danila  wrote:
>
> > I think you can put three validators on the fields, with
> > jQuery.validator.addMethod. I don't know if you can add multiple
> > validators for the same CSS class, so I'm putting extra CSS classes on
> > the inputs:
> > 
> > 
>
> > jQuery.validator.addMethod('first-name-input', validateFirstNameInput,
> > 'First name is missing.');
> > jQuery.validator.addMethod('last-name-input', validateLastNameInput,
> > 'Last name is missing.');
> > jQuery.validator.addMethod('name-input', validateNameInputs, 'First
> > and Last name are missing.');
>
> > var firstNameInput = document.getElementById('firstNameInput');
> > var lastNameInput = document.getElementById('lastNameInput');
> > function validateFirstNameInput(value, element) { return !
> > lastNameInput.value || value; }           // 1
> > function validateLastNameInput(value, element) { return
> > firstNameInput.value || value; }            // 2
> > function validateNameInputs(value, element) { return
> > firstNameInput.value && lastNameInput.value; } // 3
>
> > Validator #1 will always run for the first name input, but will choose
> > to never display a message as long as the last name input is empty. If
> > the last name input is not empty, then this validator will actually
> > check the given value (the value of the first name input) and validate
> > accordingly.
>
> > Validator #2 is in a similar situation.
>
> > Validator #3 will display an error only if both are empty.
>
> > Think of them as working together to only activate the errors when
> > only a subset of the possible conditions get applied.
>
> > I'm looking for a way to do this with a single validator myself. I
> > have dynamic forms and more complex situations, so I can't employ this
> > solution. If anyone knows how to do it, please don't hesitate to put
> > it in.
>
> > Mihai
>
> > On Jan 5, 4:26 pm, claudes  wrote:
>
> > > i have a group that contains both first and last name. i'm wondering if 
> > > it is
> > > possible to have custom messages for groups. i'm trying to achieve 
> > > something
> > > to the following:
>
> > > a. if both first and last name are not filled in: First and Last name are
> > > Required
> > > b. if only first is filled in: last name is required
> > > c. if only last is filled in: first name is required
>
> > > is this possible?
> > > --
> > > View this message in 
> > > context:http://www.nabble.com/validation-plugin%3A-how-to-add-custom-messages...
> > > Sent from the jQuery General Discussion mailing list archive at 
> > > Nabble.com.


[jQuery] Re: validation plugin: how to add custom messages for groups

2009-01-30 Thread Mihai Danila


There was a small typo in validateLastNameInput. Here's the corrected
code.



jQuery.validator.addMethod('first-name-input', validateFirstNameInput,
'First name is missing.');
jQuery.validator.addMethod('last-name-input', validateLastNameInput,
'Last name is missing.');
jQuery.validator.addMethod('name-input', validateNameInputs, 'First
and Last name are missing.');
var firstNameInput = document.getElementById('firstNameInput');
var lastNameInput = document.getElementById('lastNameInput');
function validateFirstNameInput(value, element) { return !
lastNameInput.value || value; }   // 1
function validateLastNameInput(value, element) { return !
firstNameInput.value || value; }// 2
function validateNameInputs(value, element) { return
firstNameInput.value && lastNameInput.value; } // 3



On Jan 30, 11:18 am, Mihai Danila  wrote:
> I think you can put three validators on the fields, with
> jQuery.validator.addMethod. I don't know if you can add multiple
> validators for the same CSS class, so I'm putting extra CSS classes on
> the inputs:
> 
> 
>
> jQuery.validator.addMethod('first-name-input', validateFirstNameInput,
> 'First name is missing.');
> jQuery.validator.addMethod('last-name-input', validateLastNameInput,
> 'Last name is missing.');
> jQuery.validator.addMethod('name-input', validateNameInputs, 'First
> and Last name are missing.');
>
> var firstNameInput = document.getElementById('firstNameInput');
> var lastNameInput = document.getElementById('lastNameInput');
> function validateFirstNameInput(value, element) { return !
> lastNameInput.value || value; }           // 1
> function validateLastNameInput(value, element) { return
> firstNameInput.value || value; }            // 2
> function validateNameInputs(value, element) { return
> firstNameInput.value && lastNameInput.value; } // 3
>
> Validator #1 will always run for the first name input, but will choose
> to never display a message as long as the last name input is empty. If
> the last name input is not empty, then this validator will actually
> check the given value (the value of the first name input) and validate
> accordingly.
>
> Validator #2 is in a similar situation.
>
> Validator #3 will display an error only if both are empty.
>
> Think of them as working together to only activate the errors when
> only a subset of the possible conditions get applied.
>
> I'm looking for a way to do this with a single validator myself. I
> have dynamic forms and more complex situations, so I can't employ this
> solution. If anyone knows how to do it, please don't hesitate to put
> it in.
>
> Mihai
>
> On Jan 5, 4:26 pm, claudes  wrote:
>
> > i have a group that contains both first and last name. i'm wondering if it 
> > is
> > possible to have custom messages for groups. i'm trying to achieve something
> > to the following:
>
> > a. if both first and last name are not filled in: First and Last name are
> > Required
> > b. if only first is filled in: last name is required
> > c. if only last is filled in: first name is required
>
> > is this possible?
> > --
> > View this message in 
> > context:http://www.nabble.com/validation-plugin%3A-how-to-add-custom-messages...
> > Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Re: validation plugin: how to add custom messages for groups

2009-01-30 Thread Mihai Danila


I think you can put three validators on the fields, with
jQuery.validator.addMethod. I don't know if you can add multiple
validators for the same CSS class, so I'm putting extra CSS classes on
the inputs:



jQuery.validator.addMethod('first-name-input', validateFirstNameInput,
'First name is missing.');
jQuery.validator.addMethod('last-name-input', validateLastNameInput,
'Last name is missing.');
jQuery.validator.addMethod('name-input', validateNameInputs, 'First
and Last name are missing.');

var firstNameInput = document.getElementById('firstNameInput');
var lastNameInput = document.getElementById('lastNameInput');
function validateFirstNameInput(value, element) { return !
lastNameInput.value || value; }   // 1
function validateLastNameInput(value, element) { return
firstNameInput.value || value; }// 2
function validateNameInputs(value, element) { return
firstNameInput.value && lastNameInput.value; } // 3

Validator #1 will always run for the first name input, but will choose
to never display a message as long as the last name input is empty. If
the last name input is not empty, then this validator will actually
check the given value (the value of the first name input) and validate
accordingly.

Validator #2 is in a similar situation.

Validator #3 will display an error only if both are empty.

Think of them as working together to only activate the errors when
only a subset of the possible conditions get applied.

I'm looking for a way to do this with a single validator myself. I
have dynamic forms and more complex situations, so I can't employ this
solution. If anyone knows how to do it, please don't hesitate to put
it in.


Mihai


On Jan 5, 4:26 pm, claudes  wrote:
> i have a group that contains both first and last name. i'm wondering if it is
> possible to have custom messages for groups. i'm trying to achieve something
> to the following:
>
> a. if both first and last name are not filled in: First and Last name are
> Required
> b. if only first is filled in: last name is required
> c. if only last is filled in: first name is required
>
> is this possible?
> --
> View this message in 
> context:http://www.nabble.com/validation-plugin%3A-how-to-add-custom-messages...
> Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Re: Validation Plugin: additional-methods.js

2009-01-23 Thread Jörn Zaefferer

Thanks Steve! Fixed and commited:
http://code.google.com/p/jqueryjs/source/detail?r=6159

Jörn

On Fri, Jan 23, 2009 at 4:44 AM, Steve Blades  wrote:
> Thanks again to Jorn for a fantastic plugin. One thing I noticed, with the
> additional-methods.js file that is included with the download, is a small
> error with the messages for the maxWords, minWords, and rangeWords methods.
> They are missing $.format():
> jQuery.validator.addMethod("maxWords", function(value, element, params) {
> return this.optional(element) || value.match(/\b\w+\b/g).length <
> params;
> }, $.format("Please enter {0} words or less."));
>
> jQuery.validator.addMethod("minWords", function(value, element, params) {
> return this.optional(element) || value.match(/\b\w+\b/g).length >=
> params;
> }, $.format("Please enter at least {0} words."));
>
> jQuery.validator.addMethod("rangeWords", function(value, element, params) {
> return this.optional(element) || value.match(/\b\w+\b/g).length >=
> params[0] && value.match(/bw+b/g).length < params[1];
> }, $.format("Please enter between {0} and {1} words."));
> --
> Steve "Cutter" Blades
> Adobe Certified Professional
> Advanced Macromedia ColdFusion MX 7 Developer
> _
> http://blog.cutterscrossing.com
> ---
> Co-Author 'Learning Ext JS'
> http://www.packtpub.com/learning-ext-js/book
>


[jQuery] Re: validation plugin negative number rule?

2008-12-20 Thread Jörn Zaefferer
Use min: 0.

Jörn

On Fri, Dec 19, 2008 at 8:02 PM, Adam  wrote:
>
> How can I create a rule in the validation plugin to disallow negative
> numbers.  I have a text field that should accept any number > 0
>
> thanks,
>
> A.


[jQuery] Re: validation plugin: don't insert error element

2008-12-16 Thread Jörn Zaefferer
Try this: showErrors: function() {}

Jörn

On Tue, Dec 16, 2008 at 5:45 AM, Sean Allen  wrote:
>
> Is there a way to instruct the validation plugin to not insert any error
> element?
>
>


[jQuery] Re: validation plugin question

2008-12-13 Thread Sean Allen


I copied it straight from the demo with just  a couple minor changes...

going to remove the code that I don't need once I work this out...

$(document).ready(function(){
$.validator.messages.required = "";
$("#lf").bind("invalid-form.validate", function(e, validator) {
var errors = validator.numberOfInvalids();
if (errors) {
var message = "Please complete the form:";
$("#formheader").html(message);
$("#formheader").show();
}
}).validate({
//focusInvalid: false,
//focusCleanup: true,
onkeyup: false,
submitHandler: function() {
$("div.error").hide();
alert("submit! use link below to go to the  
other step");

},
messages: {
password2: {
required: " ",
equalTo: "Please enter the same  
password as above"

},
email: {
required: " ",
email: "Please enter a valid email  
address, example: y...@yourdomain.com",
remote: jQuery.format("{0} is already  
taken, please enter a different address.")

}
},
debug:true
});

  });

relevent bit of html:

style="display:inline">


Please ship my  
FREE 7 day Trial plus Colgate kit
First Name:label> class="text required" value="" />
Last Name:label> class="text required" value="" />
Address:label> size="19" class="text required" value="" />
Address 2:label> size="19" class="text" value="" />
City:div> 
State:div>
class="stateselector required">

... state list snipped...

Zip:div> value="" class="text required" />
Phone:div> class="text required" value="" />
Email:div> class="text required email" value="" />
src="[% image.src( '/lp-cxdigital/images/button1.gif' ) %]"  
class="button1" alt="GET IT NOW" />




On Dec 13, 2008, at 12:32 PM, Jörn Zaefferer wrote:


No idea, I'd need to see some code, a testpage is prefered.

Jörn

On Sat, Dec 13, 2008 at 4:03 PM, Sean Allen > wrote:


I already have that in place.

How do I get the autogenerated label to not do  
style="display:inline" ?
In that demo there is no such element styling on the label created  
for

errors.


On Dec 12, 2008, at 4:37 PM, Jörn Zaefferer wrote:

In that demo this line hides the default messages for the required  
method:


$.validator.messages.required = "";

Jörn

On Fri, Dec 12, 2008 at 9:17 PM, Sean Allen >

wrote:


playing around with it.

don't want to get error messages displayed.

i'm just putting in a general error message at top and highlighting
required fields.
but the label for errors gets created with a display: inline set on
the element which is
thwarting me from not showing it.

looking at the marketo example ( for 2 hours now ), i see no such
display: inline being set
but can't figure out why that is.

can anyone explain?









[jQuery] Re: validation plugin question

2008-12-13 Thread Jörn Zaefferer
No idea, I'd need to see some code, a testpage is prefered.

Jörn

On Sat, Dec 13, 2008 at 4:03 PM, Sean Allen  wrote:
>
> I already have that in place.
>
> How do I get the autogenerated label to not do style="display:inline" ?
> In that demo there is no such element styling on the label created for
> errors.
>
>
> On Dec 12, 2008, at 4:37 PM, Jörn Zaefferer wrote:
>
>> In that demo this line hides the default messages for the required method:
>>
>> $.validator.messages.required = "";
>>
>> Jörn
>>
>> On Fri, Dec 12, 2008 at 9:17 PM, Sean Allen 
>> wrote:
>>>
>>> playing around with it.
>>>
>>> don't want to get error messages displayed.
>>>
>>> i'm just putting in a general error message at top and highlighting
>>> required fields.
>>> but the label for errors gets created with a display: inline set on
>>> the element which is
>>> thwarting me from not showing it.
>>>
>>> looking at the marketo example ( for 2 hours now ), i see no such
>>> display: inline being set
>>> but can't figure out why that is.
>>>
>>> can anyone explain?
>>>
>>>
>
>


[jQuery] Re: validation plugin question

2008-12-13 Thread Sean Allen


I already have that in place.

How do I get the autogenerated label to not do style="display:inline" ?
In that demo there is no such element styling on the label created for  
errors.



On Dec 12, 2008, at 4:37 PM, Jörn Zaefferer wrote:

In that demo this line hides the default messages for the required  
method:


$.validator.messages.required = "";

Jörn

On Fri, Dec 12, 2008 at 9:17 PM, Sean Allen > wrote:


playing around with it.

don't want to get error messages displayed.

i'm just putting in a general error message at top and highlighting
required fields.
but the label for errors gets created with a display: inline set on
the element which is
thwarting me from not showing it.

looking at the marketo example ( for 2 hours now ), i see no such
display: inline being set
but can't figure out why that is.

can anyone explain?






[jQuery] Re: validation plugin question

2008-12-12 Thread Jörn Zaefferer
In that demo this line hides the default messages for the required method:

$.validator.messages.required = "";

Jörn

On Fri, Dec 12, 2008 at 9:17 PM, Sean Allen  wrote:
>
> playing around with it.
>
> don't want to get error messages displayed.
>
> i'm just putting in a general error message at top and highlighting
> required fields.
> but the label for errors gets created with a display: inline set on
> the element which is
> thwarting me from not showing it.
>
> looking at the marketo example ( for 2 hours now ), i see no such
> display: inline being set
> but can't figure out why that is.
>
> can anyone explain?
>
>


[jQuery] Re: [Validation plugin] attaching onclick validation to checkboxes before submit button is clicked?

2008-10-13 Thread Jörn Zaefferer
Details about the default behaviour are here:
http://docs.jquery.com/Plugins/Validation/Reference#Validation_event

You can make the validation more aggresive with some custom event handling:

$("input[name=q4]").click(function() {
  $(this).valid();
});

Jörn

PS: You really shouldn't use a single id more then once (id="q4")

On Mon, Oct 13, 2008 at 5:34 PM, w1ntermut3 <[EMAIL PROTECTED]> wrote:
>
> Using the Validation plugin (http://docs.jquery.com/Plugins/
> Validation/)
>
> I've got checkboxes like this:
>
> 
> 
> 
> 
> 
>
> and the following code making sure that only 3 can be chosen:
>
> $(document).ready(function() {
>$('#fQuestionnaire1').validate({
>rules: {
>q4: {
>required: true,
>maxlength: 3
>}
>}
>});
> });
>
> This sort of works fine - when I click the form's Submit button, the
> error message is displayed if more than three are selected. And from
> then on,  the error message is toggled on and off by my ticking the
> required number of boxes. But - and here's my question - I want that
> behaviour BEFORE I've hit "Submit". As soon as I click that 4th
> checkbox, I want the error message to appear. Currently it's happy to
> let me select 4 items and then gives me the message when I hit
> "Submit".
>
> I notice that the docs for the validate() "onfocusout" option - which
> defaults to true - says "Validate elements (except checkboxes/radio
> buttons) on blur." Why are they excluded? It's clearly possible to do,
> because it does validate onblur AFTER the submit button has fired
> once. Is this work-aroundable? Am I missing something important?
>
> Thanks :)
>
>
>


[jQuery] Re: Validation Plugin - How to Validate input="file"

2008-09-25 Thread Jörn Zaefferer
Could you post a testpage? Usually file inputs work just fine, see
this demo: http://jquery.bassistance.de/validate/demo/errorcontainer-demo.html

Jörn

On Thu, Sep 25, 2008 at 4:03 PM, Adam <[EMAIL PROTECTED]> wrote:
>
> I'm trying to validate that someone has selected a file for upload
> before submitting a form.  I set the required class on the input
> element, but it's not being validated.  The regular text input is
> validated, however.
>
>
> action="${actionURL}" method="post" enctype="multipart/form-data"
>cssClass="update">
>
>
>Title:
>
>
>
>
>
>
>Description:
>
>
>
>
>
>Select File:
>
>
>
> 
>
>


[jQuery] Re: Validation Plugin Not Working in FF3 but okay in IE, Chrome and Opera 9.5?

2008-09-10 Thread Bill

Jörn,

Great catch that fixed it :) Thanks so much for taking a look.

Bill

On Sep 10, 8:09 am, "Jörn Zaefferer" <[EMAIL PROTECTED]>
wrote:
> Your script tag seems to get ignored in Firefox: You've got
> type="text/jscript" there, which should be text/javascript. That may
> be it.
>
> Jörn
>
> On Tue, Sep 9, 2008 at 7:24 PM, Bill <[EMAIL PROTECTED]> wrote:
>
> > I am using the great Validation plugin by Jörn Zaefferer (http://
> > bassistance.de/jquery-plugins/jquery-plugin-validation/). In my
> > project it is working fine except when the page is viewed with FF3. It
> > works fine with IE7, Chrome and Opera 9.5.
>
> > You can view my post on this project at
> >http://beckelman.net/post/2008/09/08/Client-Side-Validating-Bulk-Inse...
> > and a demo 
> > athttp://beckelman.net/Demos/jQueryValidateDDLAndTBCombo/Default.aspx.
>
> > Has anyone run across this problem?
>
> > I am using:
> > jQuery 1.2.6
> > jQuery validation plug-in 1.4
>
> > Thank you.


[jQuery] Re: Validation Plugin Not Working in FF3 but okay in IE, Chrome and Opera 9.5?

2008-09-10 Thread Jörn Zaefferer
Your script tag seems to get ignored in Firefox: You've got
type="text/jscript" there, which should be text/javascript. That may
be it.

Jörn

On Tue, Sep 9, 2008 at 7:24 PM, Bill <[EMAIL PROTECTED]> wrote:
>
> I am using the great Validation plugin by Jörn Zaefferer (http://
> bassistance.de/jquery-plugins/jquery-plugin-validation/). In my
> project it is working fine except when the page is viewed with FF3. It
> works fine with IE7, Chrome and Opera 9.5.
>
> You can view my post on this project at
> http://beckelman.net/post/2008/09/08/Client-Side-Validating-Bulk-Insert-With-jQuery-Validation-Plugin.aspx
> and a demo at 
> http://beckelman.net/Demos/jQueryValidateDDLAndTBCombo/Default.aspx.
>
> Has anyone run across this problem?
>
> I am using:
> jQuery 1.2.6
> jQuery validation plug-in 1.4
>
> Thank you.
>


[jQuery] Re: [Validation plugin] Checkbox array problem

2008-09-07 Thread faizal iqbaal
hi All ,

an interesting find...am not sure if its a bug or not..but am open to
debate.

Looking at the jquery.append()...which is considerably slow for methe
same with jquery.html()

basically the latter jquery.html() internally routes back to the
query.append() method ..is this a bug 

cause i have noticed serious perfomace impications with it when the size of
the do increases manifold...say a list box with 2 options ...

anything i am missing out here

Thanks & Regards

Faizal



On Fri, Sep 5, 2008 at 4:29 AM, Jörn Zaefferer <
[EMAIL PROTECTED]> wrote:

> See
> http://docs.jquery.com/Plugins/Validation/Reference#Fields_with_complex_names_.28brackets.2C_dots.29
>
> Jörn
>
> On Fri, Sep 5, 2008 at 12:56 AM, nonsense <[EMAIL PROTECTED]> wrote:
> >
> > Hi,
> >
> > I'm using Validation plugin (http://docs.jquery.com/Plugins/
> > Validation) and I want to use it to check whether at least one
> > checkbox is checked. Validating for one checkbox is working fine, but
> > not for group.
> >
> > HTML code:
> > 
> > 
> > 
> >
> > I tried to add "category[]: required" to rules but no success.
> >
> > Could somebody show me a working example?
> >
> > Thanks in advance,
> > nonsense
> >
>



-- 
Thanks & Regards
Faizal
(001)919 889 1980
when nothing works , prayer does.


[jQuery] Re: [Validation plugin] Checkbox array problem

2008-09-05 Thread Jörn Zaefferer
See 
http://docs.jquery.com/Plugins/Validation/Reference#Fields_with_complex_names_.28brackets.2C_dots.29

Jörn

On Fri, Sep 5, 2008 at 12:56 AM, nonsense <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I'm using Validation plugin (http://docs.jquery.com/Plugins/
> Validation) and I want to use it to check whether at least one
> checkbox is checked. Validating for one checkbox is working fine, but
> not for group.
>
> HTML code:
> 
> 
> 
>
> I tried to add "category[]: required" to rules but no success.
>
> Could somebody show me a working example?
>
> Thanks in advance,
> nonsense
>


[jQuery] Re: Validation Plugin Issue/Bug ??

2008-08-25 Thread xxkylexx

Got it. Thanks.

On Aug 25, 10:33 am, "Jörn Zaefferer" <[EMAIL PROTECTED]>
wrote:
> You can use the highlight-option to remove the success class.
>
> Jörn
>
> On Mon, Aug 25, 2008 at 4:16 AM, xxkylexx <[EMAIL PROTECTED]> wrote:
>
> > Hey guys,
> > I am using JQuery Validation Plugin and am getting a bug that I can't
> > seem to figure out.
>
> > When the user inputs a correct input, it shows my success class, but
> > if you create an error after the success class has been triggered, the
> > success class stays there with the error message as well.
>
> > For example, view my registration form 
> > here:http://www.new.imagenerd.com/register/
>
> > For username, enter a name 3 characters or more (triggers success
> > class)
> > Then, for username, erase it, or enter a username less than 3
> > characters (triggers error)
>
> > My success/valid check icon stays there with the newly triggered error
> > message. The error icon should be showing up, as is done if you create
> > an initial error.
>
> > You can do the same kind of things with the other fields and it does
> > the same. You can also view my source on the page to see how I am
> > implementing it.
>
> > Any ideas?
>
> > Thanks,
> > Kyle


[jQuery] Re: Validation Plugin Issue/Bug ??

2008-08-25 Thread Jörn Zaefferer
You can use the highlight-option to remove the success class.

Jörn

On Mon, Aug 25, 2008 at 4:16 AM, xxkylexx <[EMAIL PROTECTED]> wrote:
>
> Hey guys,
> I am using JQuery Validation Plugin and am getting a bug that I can't
> seem to figure out.
>
> When the user inputs a correct input, it shows my success class, but
> if you create an error after the success class has been triggered, the
> success class stays there with the error message as well.
>
> For example, view my registration form here: 
> http://www.new.imagenerd.com/register/
>
> For username, enter a name 3 characters or more (triggers success
> class)
> Then, for username, erase it, or enter a username less than 3
> characters (triggers error)
>
> My success/valid check icon stays there with the newly triggered error
> message. The error icon should be showing up, as is done if you create
> an initial error.
>
> You can do the same kind of things with the other fields and it does
> the same. You can also view my source on the page to see how I am
> implementing it.
>
> Any ideas?
>
> Thanks,
> Kyle
>


[jQuery] Re: Validation Plugin issue when using TinyMCE

2008-06-26 Thread shapper

Please, does anyone knows why do I need to push twice the submit
button so the validation be updated?

Thanks,
Miguel

On Jun 25, 2:01 pm, shapper <[EMAIL PROTECTED]> wrote:
> Hi,
>
> It worked but now I get a new problem which I also notice before! I
> though it was due to this but it seems it is not ...
>
> The validator only takes effect when I click the submit button twice!
>
> For example, if i place some text in the first TinyMCE text area and
> nothing on the second and click the submit button I get an error
> message on both text areas,
> If i click it again then the error message of the first text area
> disappears. And this happens in all situations.
>
> Any idea? Is this a Validation Plugin Bug?
>
> Thanks,
> Miguel
>
> On Jun 25, 12:33 am, "Josh Nathanson" <[EMAIL PROTECTED]> wrote:
>
> > I think maybe you want element.is("textarea") (no colon)
>
> > Otherwise that part of the conditional will never fire.
>
> > -- Josh
>
> > - Original Message -
> > From: "shapper" <[EMAIL PROTECTED]>
> > To: "jQuery (English)" 
> > Sent: Tuesday, June 24, 2008 4:23 PM
> > Subject: [jQuery] Re: [validate] Validation Plugin issue when using TinyMCE
>
> > You mean the { after the else? Yes, I noticed that before.
> > I keep having the same problem. The form is not validated when I use
> > errorPlacement.
>
> > I am using:
>
> >       $("#New").validate({
> >         errorClass: "Error",
> >         errorElement: "label",
> >         errorPlacement: function(error, element) {
> >           if (element.is(":textarea"))
> >             error.insertAfter(element.next());
> >           else
> >             error.insertAfter(element);
> >         },
> >         rules: {
> >           Answer: {required: true},
> >           Question: {required: true}
> >         },
> >         messages: {
> >   Answer: {required: "Insert an answer"},
> >   Question: {required: "Insert a question"}
> > }
> >       });
>
> > Any idea?
>
> > Thanks,
> > Miguel
>
> > On Jun 24, 11:18 pm, "Jörn Zaefferer" <[EMAIL PROTECTED]>
> > wrote:
> > > There was a syntax error in the errorPlacement, try this:
>
> > > errorPlacement: function(error, element) {
> > > if (element.is(":textarea"))
> > > error.insertAfter(element.next());
> > > else
> > > error.insertAfter(element);
> > > },
>
> > > On Tue, Jun 24, 2008 at 11:36 PM, shapper <[EMAIL PROTECTED]> wrote:
>
> > > > Hello,
>
> > > > I have been trying to make JQuery Validation with TinyMCE and until
> > > > now I wasn't able to do this. I have 2 text areas converted to
> > > > TinyMCE. I am using:
>
> > > > $("#New").validate({
> > > > errorClass: "Error",
> > > > errorElement: "label",
> > > > errorPlacement: function(error, element) {
> > > > if (element.is(":textarea"))
> > > > error.insertAfter(element.next());
> > > > else {
> > > > error.insertAfter(element);
> > > > },
> > > > rules: {
> > > > Answer: {required: true},
> > > > Question: {required: true}
> > > > },
> > > > messages: {
> > > > Answer: {required: "Insert an answer"},
> > > > Question: {required: "Insert a question"}
> > > > }
> > > > });
>
> > > > Using this code does not even validate. The form is submited. If I
> > > > remove the errorReplacement part then it works but the error message
> > > > is out of place.
>
> > > > I tried many options but until now I wasn't able to make this work.
>
> > > > Any idea how to solve this?
>
> > > > Thanks,
> > > > Miguel
>
> > > > On Jun 24, 3:01 pm, "Jörn Zaefferer" <[EMAIL PROTECTED]>
> > > > wrote:
> > > >> How about this:
>
> > > >> errorPlacement: function(error, element) {
> > > >> if (element.is(":textarea"))
> > > >> error.insertAfter(element.next());
> > > >> else {
> > > >> error.insertAfter(element);
>
> > > >> }
>
> > > >> Jörn
>
> > > >> On Tue, Jun 24, 2008 at 2:18 PM, shapper <[EMAIL PROTECTED]> wrote:
>
> > > >> > Hello,
>
> > > >> > I checked the markup used by TinyMCE and it is something as follows:
>
> > > >> > Question
> > > >> >  > > >> > style="display: none;"/>
> > > >> > 
> > > >> >  > > >> > cellpadding="0" style="width: 538px; height: 175px;">
> > > >> > 
> > > >> > .
> > > >> > 
> > > >> > 
> > > >> > 
>
> > > >> > So the textarea is disabled and replaced by a span and table ...
>
> > > >> > I then changed my validation code to:
>
> > > >> > $("#New").validate({
> > > >> > errorClass: "Error",
> > > >> > errorElement: "label",
> > > >> > rules: {Question: {required: true}},
> > > >> > errorPlacement: function(error, element) {
> > > >> > if (element.is(":textarea"))
> > > >> > error.appendTo(element.parent().next().next('textarea'));
> > > >> > }
> > > >> > });
>
> > > >> > This is not working. Could you, please, tell me what am I doing
> > > >> > wrong?
> > > >> > I also tried with table but no success.
>
> > > >> > On Jun 23, 9:57 am, "Jörn Zaefferer" <[EMAIL PROTECTED]>
> > > >> > wrote:
> > > >> >> Most likely TinyMCE creates a new element and places it after the
> > > >> >> textarea, hiding the former. Use the errorPlacement-option to
> > > >>

[jQuery] Re: Validation plugin help please

2008-06-25 Thread Lossed

Hi,

Sorry, I can't..

But if you copy and paste the exact code I have advised, and include
the requisite jQuery and validation JS, you can see locally the issue
that still baffles me.
Any help figuring out where I'm going wrong would be great, thanks.

On Jun 20, 3:17 am, "Jörn Zaefferer" <[EMAIL PROTECTED]>
wrote:
> Please post a testpage.
>
> Jörn
>
> On Wed, Jun 18, 2008 at 1:53 AM, Lossed <[EMAIL PROTECTED]> wrote:
>
> > Hi. I tried posting this to the plugin group days ago but it's not
> > showing
> > and I'm not sure if it's every going to show.
>
> > My form disappears when the focus changes between form fields. Here's
> > an example:
> > --
>
> > 
> >   $(document).ready(function() {
> >   var errorBox=$("div ul  li  div.duh");
> >   $("#theForm").validate({
> >   rules: {
> >   input1: {
> >   required: true,
> >   number: true
> >   }
> >   },
> >   messages: {
> >   input1: 'input1 error'
> >   },
> >   errorContainer: errorBox,
> >   errorLabelContainer: $("ul",errorBox),
> >   wrapper: 'li'
> >   });
> >   });
> > 
>
> > 
> >   
> >   
> >   
> >   
> >   
> >   1
> >   2
> >   
> >> value="test">
> >   
> >   
> >   
> >   
> > 
> > ---
>
> > If I click submit, the error container correctly shows the errors, and
> > with the errors showing, I can tab through the fields fine. But if I
> > refresh the form, so it's not showing errors, and try tabbing through
> > them, the form disappears. Also, if I just run the form and error
> > container div by themselves, not nested in all the other elements, and
> > point the JS to just the error div, such as: var errorBox=$
> > ("div.duh");
> > then the form works fine and I can tab through the fields no problem.
>
> > Can anyone see what I'm doing wrong please?
> > This is my first attempt with this plugin and I am lost. I've looked
> > at the docs and example but am not sure what I'm missing or have
> > wrong :(


[jQuery] Re: Validation plugin help please

2008-06-19 Thread Jörn Zaefferer

Please post a testpage.

Jörn

On Wed, Jun 18, 2008 at 1:53 AM, Lossed <[EMAIL PROTECTED]> wrote:
>
> Hi. I tried posting this to the plugin group days ago but it's not
> showing
> and I'm not sure if it's every going to show.
>
>
> My form disappears when the focus changes between form fields. Here's
> an example:
> --
>
> 
>   $(document).ready(function() {
>   var errorBox=$("div ul  li  div.duh");
>   $("#theForm").validate({
>   rules: {
>   input1: {
>   required: true,
>   number: true
>   }
>   },
>   messages: {
>   input1: 'input1 error'
>   },
>   errorContainer: errorBox,
>   errorLabelContainer: $("ul",errorBox),
>   wrapper: 'li'
>   });
>   });
> 
>
> 
>   
>   
>   
>   
>   
>   1
>   2
>   
>value="test">
>   
>   
>   
>   
> 
> ---
>
> If I click submit, the error container correctly shows the errors, and
> with the errors showing, I can tab through the fields fine. But if I
> refresh the form, so it's not showing errors, and try tabbing through
> them, the form disappears. Also, if I just run the form and error
> container div by themselves, not nested in all the other elements, and
> point the JS to just the error div, such as: var errorBox=$
> ("div.duh");
> then the form works fine and I can tab through the fields no problem.
>
> Can anyone see what I'm doing wrong please?
> This is my first attempt with this plugin and I am lost. I've looked
> at the docs and example but am not sure what I'm missing or have
> wrong :(
>


[jQuery] Re: Validation Plugin Mod

2008-06-01 Thread Matt Quackenbush
All fixed up.  :-)

Thanks to Jorn for an awesome plugin!


[jQuery] Re: Validation Plugin Mod

2008-06-01 Thread Matt Quackenbush
Okay, problem #2 from the original post has been solved.  I finally found
the .errors() function and was able to modify it to suit my purposes.

Any ideas on how to solve problem #1 would be much appreciated.  :-)


Thanks,

Matt


[jQuery] Re: Validation Plugin Mod

2008-06-01 Thread Matt Quackenbush
I'm 99.9% certain that I have correctly deduced that the reason for the
continued addition of the error messages to the DOM is that the errorsFor:
function() [see below] is not finding the ones that have been added already.


errorsFor: function(element) {
> return this.errors().filter('p[id="error-' + this.idOrName(element) +
> '"]');  // edited MQ - p[id=error- instead of [EMAIL PROTECTED]
> },
>



What I'm not sure of is _why_ it's not finding anything.  I have also tried

.filter("[EMAIL PROTECTED]'error-" + this.idOrName(element) + "']");

but still without success.  I have searched around the docs and the script
itself to try and learn what .errors() does, but have not yet been able to
find anything on it.  I thought maybe it returned an array of elements that
have the class of 'error' attached to them, but that does not seem to be the
case.

Can anyone point me in the right direction?

Once again, you can see this in action at
http://www.quackfuzed.com/stuff/jquery/.


Thanks,

Matt


[jQuery] Re: Validation Plugin Doesn't work with jQuery 1.2.5

2008-05-25 Thread Jörn Zaefferer

Please update to jQuery 1.2.6, the issue causing the validation plugin
to fail is fixed there.

Jörn

On Sun, May 25, 2008 at 1:56 PM,  <[EMAIL PROTECTED]> wrote:
>
> My system it's working with jQuery 1.2.3 and has the validation Plugin
> with the latest version , but When I changed the jquery to 1.2.5 it
> doesn't work 
> What is the Problem
>


[jQuery] Re: Validation Plugin remote method

2008-05-13 Thread Jörn Zaefferer

You can use the php file provided in the download (within
demo/marekto) as a reference to get the parameter and return the
result. I can't help you with actually implementing the check, which
most likely needs to select something from a database to check if the
address already exists. There are plenty books and sites on PHP and
MySQL.

On Tue, May 13, 2008 at 3:47 PM, hcvitto <[EMAIL PROTECTED]> wrote:
>
>  hi
>  i'm trying to do a remote validation on an email field just like the
>  Marketo sign-up form one!
>  I'm not a programmer (don't know json too) and i don't exactly know
>  what to put in my "email.php" file (which does the actual check). At
>  the moment it just does a normal php check therefore nothin' happens.
>  Could anyone give me some clue or some good link to read from?
>
>  Thanks
>  Vitto
>


[jQuery] Re: Validation Plugin Add Row Example

2008-04-13 Thread Jörn Zaefferer


HatemJaber schrieb:

I am using the Validation plugin from http://jquery.bassistance.de/validate/demo
which is a great plugin. I just found out after browsing the docs some
more that it has the capability of dynamically adding a row of data. I
would like to know how I can remove a row of data. After several
attempts at creating a removeJoin() function, and a couple of hours of
hacking it up, I decided to join the group.

[...]
All you need to do is to remove the row you added, eg. 
$("tr:last").remove() to remove the last row.


Jörn


[jQuery] Re: Validation Plugin - Associate array naming with a single error label

2008-02-04 Thread Jörn Zaefferer


Dave Stewart schrieb:

Jorn,
I've done some work on selectors for groups, and it's actually quite
easy to select a group or sub group for validation, although I don't
know the details of your implementation, so I wont suppose to imply
anything.

As usual I've uploaded some demo code for you to take a look.

www.janepatrick.co.uk/admin/test/associative-select.php

Hopefully this will save you some thinking time!
  

Thanks, I'll take a look once 1.2.1 is out the door (and some other stuff).

Jörn


[jQuery] Re: Validation Plugin - Associate array naming with a single error label

2008-02-02 Thread Dave Stewart

Jorn,
I've done some work on selectors for groups, and it's actually quite
easy to select a group or sub group for validation, although I don't
know the details of your implementation, so I wont suppose to imply
anything.

As usual I've uploaded some demo code for you to take a look.

www.janepatrick.co.uk/admin/test/associative-select.php

Hopefully this will save you some thinking time!

Cheers,
Dave


[jQuery] Re: Validation Plugin - Associate array naming with a single error label

2008-02-01 Thread Jörn Zaefferer


Dave Stewart schrieb:

Jorn,
Here is a live example.

http://www.janepatrick.co.uk/admin/test/associative.php

Hopefully it's in your interest to examine this issue further!
  

Thanks, I'll definitely take a look, though it won't make it into 1.2.1.

Jörn


[jQuery] Re: Validation Plugin - Associate array naming with a single error label

2008-02-01 Thread Dave Stewart

Jorn,
Here is a live example.

http://www.janepatrick.co.uk/admin/test/associative.php

Hopefully it's in your interest to examine this issue further!
Many thanks,
dave


[jQuery] Re: Validation plugin - spinner while validating field?

2008-01-31 Thread Jörn Zaefferer


Rus Miller schrieb:

Also, I noticed that even though the 'Check URL' field on my form
(http://monovisiondesign.com/client/jquery/validate-url/form.php) is
not required, it still performs a remote call and a label.checked is
applied to the field when it's left empty.  Am I doing something wrong
or is there a way to prevent that?
  
Good point. Whats happening: The field is checked if it has any rules. 
If it hasn't, nothing happens. If it has, they are executed. Now the 
remote validation returns that the field is valid, because not required 
and nothing was entered, and the field is marked as valid.


Currently I see no reason to change that to not apply any "message" to 
the field at all in this case, which should be what you are looking for, 
right?


Let me know, otherwise I'll just fix that for 1.2.1.

Jörn


[jQuery] Re: Validation plugin - spinner while validating field?

2008-01-30 Thread Rus Miller

My issue is that remote requests, especially those involving an
external server, can take a second or two.   It's nice to give the
user an indication that something is happening, which is why a spinner
isn't 'useless'.  It would be great if someone could give me a push in
the right direction.

Also, I noticed that even though the 'Check URL' field on my form
(http://monovisiondesign.com/client/jquery/validate-url/form.php) is
not required, it still performs a remote call and a label.checked is
applied to the field when it's left empty.  Am I doing something wrong
or is there a way to prevent that?

On Jan 30, 1:17 pm, Jörn Zaefferer <[EMAIL PROTECTED]> wrote:
> Rus Miller schrieb:> There is a label.error and a label.checked but does 
> anyone know how I
> > would display a label.pending (perhaps with a spinner) while the
> > validation (especially a remote request) is happening?
>
> > Thanks.
>
> You can still use jQuery's ajax events to display a 
> busy-indicator:http://docs.jquery.com/Ajax_Events
>
> I acutally considered a pending state for remote-validated-fields, but
> dropped the idea in favor of a lack of those useless spinner icons. I
> found the goal to make the remote validation as unobtrusive as possible
> to the user a more worthwhile goal.
>
> Jörn


[jQuery] Re: Validation plugin - spinner while validating field?

2008-01-30 Thread Jörn Zaefferer


Rus Miller schrieb:

There is a label.error and a label.checked but does anyone know how I
would display a label.pending (perhaps with a spinner) while the
validation (especially a remote request) is happening?

Thanks.
  
You can still use jQuery's ajax events to display a busy-indicator: 
http://docs.jquery.com/Ajax_Events


I acutally considered a pending state for remote-validated-fields, but 
dropped the idea in favor of a lack of those useless spinner icons. I 
found the goal to make the remote validation as unobtrusive as possible 
to the user a more worthwhile goal.


Jörn



[jQuery] Re: Validation Plugin - Associate array naming with a single error label

2008-01-29 Thread Dave Stewart

I made a small discovery (in my sleep no less!) that works in HTML,
but screws up the PHP:

HTML:
If I put the array properties in single quotes (the spaces are to make
it clearer), the controls are validated as a group! This is good.




PHP:
However, the PHP also receives those single quotes, so variable names
now come through like this:

[ ' property_1 ' ] => 1
[ ' property_2 ' ] => 2

This is not good.

Hopefully someone (Jorn!?) will have the solution.
Thanks,
Dave


[jQuery] Re: Validation Plugin - using required inside of addMethod

2008-01-15 Thread Jörn Zaefferer


Tristan schrieb:

Hi,

I'm trying to create a new custom validation method similar to the
other methods included in 'additional-methods.js'. I've created my
method like this:
jQuery.validator.addMethod('dateAfter', function(value, element,
param) {
var dVal = new Date();
var dParam = new Date();
dVal.setTime(Date.parse(value));
param.indexOf('#') > -1 ?
dParam.setTime(Date.parse(jQuery(param).val())) :
dParam.setTime(Date.parse(param));
return !jQuery.validator.methods.required(value, element) || ((!/
Invalid|NaN/.test(dVal) && !/Invalid|NaN/.test(dParam)) && (dVal >
dParam));
}, 'End date cannot be before start date.');

When running this method, it errors out while executing
jQuery.validator.methods.required(value, element). This is because
jQuery.validator.methods.required executes this.depend(param, element)
which is not available to the newly created method. Has anyone found a
way around this while creating custom validation methods?
  
Please take a look at how that check is implemented in the latest 
revision: 
http://dev.jquery.com/view/trunk/plugins/validate/additional-methods.js


Basically all you need is "return this.optional(element) || ...", though 
that won't work with the current release (1.1.2). 1.2 should be out 
really soon, and you can already check out the latest revision: 
http://dev.jquery.com/view/trunk/plugins/validate/ 
(lib/jquery.delegate.js is always required)


Jörn



[jQuery] Re: Validation plugin docs: links not working

2008-01-09 Thread Gonzo

Thanks for catching that.  The docs for the validation plugin are
currently being moved from the source code to the wiki and there has
also been some re-organization for the upcoming release of v1.2, so
the docs may be out of sync with the code for a few more days.  We'll
make sure to get these links fixed.


On Jan 9, 4:32 am, oLLi- <[EMAIL PROTECTED]> wrote:
> Last links (Demos) on pagehttp://docs.jquery.com/Plugins/Validation
> are not to be found:
>
>  http://dev.jquery.com/view/trunk/plugins/validate/demo-test/marketo/
>  http://dev.jquery.com/view/trunk/plugins/validate/demo-test/milk/
>
> Instead I managed to locate these resources at:
>
>  http://dev.jquery.com/view/trunk/plugins/validate/demo/marketo/
>  http://dev.jquery.com/view/trunk/plugins/validate/demo/milk/


[jQuery] Re: validation plugin: validation of checkboxes fail

2007-10-14 Thread Jörn Zaefferer


Alexander Graef schrieb:

Hi,
thanks :) How would I reference the name for the rule and message
preferences ?

Using test[] would break the javascript, can I use 'test[]' as the key
value? 
  

Sure, this is legal javascript:

rules: {
   'test[]': "required"
}

-- Jörn


[jQuery] Re: validation plugin: validation of checkboxes fail

2007-10-12 Thread Alexander Graef


Did a workaround that I should have thought of before :), using the provided
submitHandler function.

For those looking for a similar solution, here it is :

$("#Form").validate({
submitHandler: function(form) {

$(".multi").each(function(i){

var val = $(this).attr("name");
$(this).attr("name", val+"[]");
   }

);

$(form).submit();
}
});

Cheers
Alexander

--
portalZINE®- innovation uncovered
http://www.portalzine.de
 
dev. portalZINE® - all about development
http://dev.portalzine.de
 
pro. portalZINE® - customized experience
http://pro.portalzine.de
-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Alexander Graef
Sent: Thursday, October 11, 2007 7:52 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: validation plugin: validation of checkboxes fail


Hi,
thanks :) How would I reference the name for the rule and message
preferences ?

Using test[] would break the javascript, can I use 'test[]' as the key
value? 

Will give it a try.

Cheers
Alexander  
-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Jörn Zaefferer
Sent: Thursday, October 11, 2007 6:26 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: validation plugin: validation of checkboxes fail


Alexander Graef schrieb:
> Hi,
>
> For the multi select:
> 
>   one
>   two
>   three
>   four
>   five
> 
>
> This allows you to pass the selected items via a form post and receive
them
> as an array.
>
> Same applies for the checkboxes:
>
> Steak:
> Pizza:
> Chicken:
>   
If your serverside prefers that format, thats the way to go. The 1.1 
release may have a problem with those, until 1.2, please give the latest 
revision a try: http://dev.jquery.com/view/trunk/plugins/validate/

Regards
Jörn


__ NOD32 2586 (20071011) Information __

This message was checked by NOD32 antivirus system.
http://www.eset.com




__ NOD32 2586 (20071011) Information __

This message was checked by NOD32 antivirus system.
http://www.eset.com




[jQuery] Re: validation plugin: validation of checkboxes fail

2007-10-11 Thread Alexander Graef

Hi,
thanks :) How would I reference the name for the rule and message
preferences ?

Using test[] would break the javascript, can I use 'test[]' as the key
value? 

Will give it a try.

Cheers
Alexander  
-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Jörn Zaefferer
Sent: Thursday, October 11, 2007 6:26 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: validation plugin: validation of checkboxes fail


Alexander Graef schrieb:
> Hi,
>
> For the multi select:
> 
>   one
>   two
>   three
>   four
>   five
> 
>
> This allows you to pass the selected items via a form post and receive
them
> as an array.
>
> Same applies for the checkboxes:
>
> Steak:
> Pizza:
> Chicken:
>   
If your serverside prefers that format, thats the way to go. The 1.1 
release may have a problem with those, until 1.2, please give the latest 
revision a try: http://dev.jquery.com/view/trunk/plugins/validate/

Regards
Jörn


__ NOD32 2586 (20071011) Information __

This message was checked by NOD32 antivirus system.
http://www.eset.com




[jQuery] Re: validation plugin: validation of checkboxes fail

2007-10-11 Thread Jörn Zaefferer


Alexander Graef schrieb:

Hi,

For the multi select:

one
two
three
four
five


This allows you to pass the selected items via a form post and receive them
as an array.

Same applies for the checkboxes:

Steak:
Pizza:
Chicken:
  
If your serverside prefers that format, thats the way to go. The 1.1 
release may have a problem with those, until 1.2, please give the latest 
revision a try: http://dev.jquery.com/view/trunk/plugins/validate/


Regards
Jörn


[jQuery] Re: validation plugin: validation of checkboxes fail

2007-10-10 Thread Alexander Graef

Hi,

For the multi select:

one
two
three
four
five


This allows you to pass the selected items via a form post and receive them
as an array.

Same applies for the checkboxes:

Steak:
Pizza:
Chicken:

When I said, a unique name is required, I was not refering to the specs, but
to the retrieval of information. So either allow the values to be passed as
an array or use an unique name for each and allow the grouping of them with
another attribute for validation.
 
Cheers
Alexander

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Jörn Zaefferer
Sent: Wednesday, October 10, 2007 8:30 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: validation plugin: validation of checkboxes fail


Alexander Graef schrieb:
> [...]
> This is a wrong scenario, as normally each checkbox has its own unique
name within a form. The validation fails if the names are different for each
checkbox. How do I chain them for validation with each checkbox having its
own name ?
>  [...]
>
I have no idea how to identify a group of checkboxes without a common 
name. And this is the first time I read that checkboxes need a unique 
name. The HTML spec 
(http://www.w3.org/TR/html401/interact/forms.html#checkbox) says:

 > Several checkboxes in a form may share the same control name. 
<http://www.w3.org/TR/html401/interact/forms.html#control-name> Thus, 
for example, checkboxes allow users to select several values for the 
same property.

Could you recheck your resources?

-- Jörn


__ NOD32 2584 (20071010) Information __

This message was checked by NOD32 antivirus system.
http://www.eset.com




[jQuery] Re: validation plugin: validation of checkboxes fail

2007-10-10 Thread Jörn Zaefferer


Alexander Graef schrieb:

[...]
This is a wrong scenario, as normally each checkbox has its own unique name 
within a form. The validation fails if the names are different for each 
checkbox. How do I chain them for validation with each checkbox having its own 
name ?
 [...]

I have no idea how to identify a group of checkboxes without a common 
name. And this is the first time I read that checkboxes need a unique 
name. The HTML spec 
(http://www.w3.org/TR/html401/interact/forms.html#checkbox) says:


> Several checkboxes in a form may share the same control name. 
 Thus, 
for example, checkboxes allow users to select several values for the 
same property.


Could you recheck your resources?

-- Jörn


[jQuery] Re: Validation plugin errors on IE6

2007-10-06 Thread Josh Nathanson


I have also found that the unpacked version works fine, but the packed 
version doesn't work on IE6.  I tried repacking without "base62encode" and 
"shrink variables" checked, to no avail.  I get error something like 
"missing '(' in regular expression".


-- Josh




- Original Message - 
From: "wattaka" <[EMAIL PROTECTED]>

To: "jQuery (English)" 
Sent: Saturday, October 06, 2007 6:11 AM
Subject: [jQuery] Re: Validation plugin errors on IE6



Hi Jörn,

The valide.js works, the validate pack does not, same error as before.
Thanks. Just let me know, I´ll be glad to test.



On Oct 6, 12:41 pm, Jörn Zaefferer <[EMAIL PROTECTED]> wrote:
wattaka schrieb:> This is just plain infuriating, this piece code works 
perfectly well

> on FF 2, on IE6 , it just causes errors:
> [...]
> Does anyone have any ideas?

Could you please give the latest revision a 
try?http://dev.jquery.com/view/trunk/plugins/validate/

I haven't managed to just release a fix yet...

-- Jörn




[jQuery] Re: Validation plugin errors on IE6

2007-10-06 Thread wattaka

Hi Jörn,

The valide.js works, the validate pack does not, same error as before.
Thanks. Just let me know, I´ll be glad to test.



On Oct 6, 12:41 pm, Jörn Zaefferer <[EMAIL PROTECTED]> wrote:
> wattaka schrieb:> This is just plain infuriating, this piece code works 
> perfectly well
> > on FF 2, on IE6 , it just causes errors:
> > [...]
> > Does anyone have any ideas?
>
> Could you please give the latest revision a 
> try?http://dev.jquery.com/view/trunk/plugins/validate/
> I haven't managed to just release a fix yet...
>
> -- Jörn



[jQuery] Re: Validation plugin errors on IE6

2007-10-06 Thread Jörn Zaefferer


wattaka schrieb:

This is just plain infuriating, this piece code works perfectly well
on FF 2, on IE6 , it just causes errors:
[...]
Does anyone have any ideas?
  
Could you please give the latest revision a try? 
http://dev.jquery.com/view/trunk/plugins/validate/

I haven't managed to just release a fix yet...

-- Jörn



[jQuery] Re: Validation plugin noob SOLVED

2007-09-28 Thread Josh Nathanson


OK, my html was not valid - I had improperly nested form tags.  I guess FF 
is more strict about that sort of thing.  Working fine now.


-- Josh


- Original Message - 
From: "seedy" <[EMAIL PROTECTED]>

To: 
Sent: Friday, September 28, 2007 1:38 PM
Subject: [jQuery] Re: Validation plugin noob





are your fields inside a table?
I was seeing that in IE, if fields were in a table cell, the errors were
being added but the cell wasn't getting larger and the errors could not be
seen.


Josh Nathanson-3 wrote:



Hey all,

Using Jorn's Validation plugin, it's not displaying the error message.  I
must be missing something obvious.  I'm just trying a test - it seems 
like

when I submit, if the field is empty, it should display an error message
after the input field.  What am I doing wrong?

JS:
$("#editform").validate({
  rules: {
FirstName : "required"
},
  messages: {
FirstName : "Please enter your first name."
},
  debug: true
 });

Markup:


-- Josh





--
View this message in context: 
http://www.nabble.com/Validation-plugin-noob-tf4536315s15494.html#a12948063

Sent from the JQuery mailing list archive at Nabble.com.





[jQuery] Re: Validation plugin noob

2007-09-28 Thread Josh Nathanson


OK, I added in errorElement: "div" to the options, and now it works in IE, 
but in Firefox it does not append the error message.  When I use Firebug -> 
Inspect, I can see that the error message is not being appended after the 
input element.  What gives, any ideas?


- Josh

- Original Message - 
From: "seedy" <[EMAIL PROTECTED]>

To: 
Sent: Friday, September 28, 2007 1:38 PM
Subject: [jQuery] Re: Validation plugin noob





are your fields inside a table?
I was seeing that in IE, if fields were in a table cell, the errors were
being added but the cell wasn't getting larger and the errors could not be
seen.


Josh Nathanson-3 wrote:



Hey all,

Using Jorn's Validation plugin, it's not displaying the error message.  I
must be missing something obvious.  I'm just trying a test - it seems 
like

when I submit, if the field is empty, it should display an error message
after the input field.  What am I doing wrong?

JS:
$("#editform").validate({
  rules: {
FirstName : "required"
},
  messages: {
FirstName : "Please enter your first name."
},
  debug: true
 });

Markup:


-- Josh





--
View this message in context: 
http://www.nabble.com/Validation-plugin-noob-tf4536315s15494.html#a12948063

Sent from the JQuery mailing list archive at Nabble.com.





[jQuery] Re: Validation plugin noob

2007-09-28 Thread Josh Nathanson


Yes they are in a table - that may be the issue - although I'm testing in 
FF.  I'll make some changes and report back.


-- Josh

- Original Message - 
From: "seedy" <[EMAIL PROTECTED]>

To: 
Sent: Friday, September 28, 2007 1:38 PM
Subject: [jQuery] Re: Validation plugin noob





are your fields inside a table?
I was seeing that in IE, if fields were in a table cell, the errors were
being added but the cell wasn't getting larger and the errors could not be
seen.


Josh Nathanson-3 wrote:



Hey all,

Using Jorn's Validation plugin, it's not displaying the error message.  I
must be missing something obvious.  I'm just trying a test - it seems 
like

when I submit, if the field is empty, it should display an error message
after the input field.  What am I doing wrong?

JS:
$("#editform").validate({
  rules: {
FirstName : "required"
},
  messages: {
FirstName : "Please enter your first name."
},
  debug: true
 });

Markup:


-- Josh





--
View this message in context: 
http://www.nabble.com/Validation-plugin-noob-tf4536315s15494.html#a12948063

Sent from the JQuery mailing list archive at Nabble.com.





[jQuery] Re: Validation plugin noob

2007-09-28 Thread seedy


are your fields inside a table?
I was seeing that in IE, if fields were in a table cell, the errors were
being added but the cell wasn't getting larger and the errors could not be
seen.


Josh Nathanson-3 wrote:
> 
> 
> Hey all,
> 
> Using Jorn's Validation plugin, it's not displaying the error message.  I 
> must be missing something obvious.  I'm just trying a test - it seems like 
> when I submit, if the field is empty, it should display an error message 
> after the input field.  What am I doing wrong?
> 
> JS:
> $("#editform").validate({
>   rules: {
> FirstName : "required"
> },
>   messages: {
> FirstName : "Please enter your first name."
> },
>   debug: true
>  });
> 
> Markup:
>  class="formfield" maxlength="50">
> 
> -- Josh 
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Validation-plugin-noob-tf4536315s15494.html#a12948063
Sent from the JQuery mailing list archive at Nabble.com.



[jQuery] Re: Validation plugin noob

2007-09-28 Thread Web Specialist
I'm using Dan G Switzer approach to show error messages. Looks like this:

   // para qualquer campo no form de nome frm adiciona um evento
onfocus
// for any field in your form with name frm adds an onfocus event

$("#frm input").focus(
function (){
// remove a class de erro do campo
// remove error class to the field
$(this).removeClass("error");

// para campos checkbox e radio o nome do label deve ser
igual ao nome do campo e igual ao
// atributo id para todos os outros campos
// for checkbox and radio fields , label name needs to be equal to the field
var sLabelName = ($(this)[0].type == "checkbox" ||
$(this)[0].type == "radio") ? $(this)[0].name : $(this)[0].id ;

// oculta a mensagem de erro para o campo atual
// hides error message for the actual field
$("[EMAIL PROTECTED]" + $(this)[0].name +
"[EMAIL PROTECTED]").hide();
}
);

Cheers
Marco Antonio

2007/9/28, Josh Nathanson <[EMAIL PROTECTED]>:
>
>
> Hi Rick,
>
> That was the first thing I tried, it didn't work.  Then it seemed to say
> in
> the docs that the label element would be created for you, and placed after
> the input field, so I took out the label markup, and that also didn't
> work.
>
> I know I've got the js file included correctly, and it's doing
> *something*,
> because when I set debug = true, the form doesn't submit.
>
> -- Josh
>
>
>
> - Original Message -
> From: "Rick Faircloth" <[EMAIL PROTECTED]>
> To: 
> Sent: Friday, September 28, 2007 12:55 PM
> Subject: [jQuery] Re: Validation plugin noob
>
>
> >
> > Hi, Josh...
> >
> > In your HTML, did you specify a place for the error
> > message to appear?
> >
> > This is from Jorn's example:
> >
> > Firstname
> > 
> >
> > I handle my error messages a little different than the
> > example above, preferring my error messages above the input field.
> >
> > If I'm not mistaken I believe you're going to need a  > for the default messages to appear.
> >
> > Hopefully someone will come along who can tell you for sure.
> >
> > But check's Jorn's source on:
> >
> > http://jquery.bassistance.de/validate/demo-test/
> >
> > And it may give you some clues about how the HTML works.
> >
> > Rick
> >
> >
> > -Original Message-
> > From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
> > Behalf Of Josh Nathanson
> > Sent: Friday, September 28, 2007 3:18 PM
> > To: jquery-en@googlegroups.com
> > Subject: [jQuery] Validation plugin noob
> >
> >
> > Hey all,
> >
> > Using Jorn's Validation plugin, it's not displaying the error
> message.  I
> > must be missing something obvious.  I'm just trying a test - it seems
> like
> > when I submit, if the field is empty, it should display an error message
> > after the input field.  What am I doing wrong?
> >
> > JS:
> > $("#editform").validate({
> >  rules: {
> >FirstName : "required"
> >},
> >  messages: {
> >FirstName : "Please enter your first name."
> >},
> >  debug: true
> > });
> >
> > Markup:
> >  > class="formfield" maxlength="50">
> >
> > -- Josh
> >
> >
> >
>
>


[jQuery] Re: Validation plugin noob

2007-09-28 Thread Josh Nathanson


Hi Rick,

That was the first thing I tried, it didn't work.  Then it seemed to say in 
the docs that the label element would be created for you, and placed after 
the input field, so I took out the label markup, and that also didn't work.


I know I've got the js file included correctly, and it's doing *something*, 
because when I set debug = true, the form doesn't submit.


-- Josh



- Original Message - 
From: "Rick Faircloth" <[EMAIL PROTECTED]>

To: 
Sent: Friday, September 28, 2007 12:55 PM
Subject: [jQuery] Re: Validation plugin noob




Hi, Josh...

In your HTML, did you specify a place for the error
message to appear?

This is from Jorn's example:

Firstname


I handle my error messages a little different than the
example above, preferring my error messages above the input field.

If I'm not mistaken I believe you're going to need a http://jquery.bassistance.de/validate/demo-test/

And it may give you some clues about how the HTML works.

Rick


-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Josh Nathanson
Sent: Friday, September 28, 2007 3:18 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Validation plugin noob


Hey all,

Using Jorn's Validation plugin, it's not displaying the error message.  I
must be missing something obvious.  I'm just trying a test - it seems like
when I submit, if the field is empty, it should display an error message
after the input field.  What am I doing wrong?

JS:
$("#editform").validate({
 rules: {
   FirstName : "required"
   },
 messages: {
   FirstName : "Please enter your first name."
   },
 debug: true
});

Markup:


-- Josh







[jQuery] Re: Validation plugin noob

2007-09-28 Thread Rick Faircloth

Hi, Josh...

In your HTML, did you specify a place for the error
message to appear?

This is from Jorn's example:

Firstname


I handle my error messages a little different than the
example above, preferring my error messages above the input field.

If I'm not mistaken I believe you're going to need a http://jquery.bassistance.de/validate/demo-test/

And it may give you some clues about how the HTML works.

Rick


-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Josh Nathanson
Sent: Friday, September 28, 2007 3:18 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Validation plugin noob


Hey all,

Using Jorn's Validation plugin, it's not displaying the error message.  I 
must be missing something obvious.  I'm just trying a test - it seems like 
when I submit, if the field is empty, it should display an error message 
after the input field.  What am I doing wrong?

JS:
$("#editform").validate({
  rules: {
FirstName : "required"
},
  messages: {
FirstName : "Please enter your first name."
},
  debug: true
 });

Markup:


-- Josh 





[jQuery] Re: Validation plugin - alphanumeric password with min length

2007-09-27 Thread Jörn Zaefferer


voltron schrieb:

Hi Jörn, I think it works now. Do the errors which I define in the
error_container override the default ones in the plugin? Maybe it
would be cool to make this a default validator for your plugin? I
think many others might want this functionality. Thanks for looking
into this problem.
  
Sure. I'll add it to additional-methods for now, if there are more 
requests I'll add it to the default methods.


-- Jörn


  1   2   >