[jQuery] VALIDATE

2010-03-02 Thread AMARJEET
Hi Jörn Zaefferer,

Is there any reason validator Plugin not supporting
validate multiple form fields with identical names

Is there any way to validate Identical Names Fields?


Thanks
Amarjeet


[jQuery] “(validate)”

2010-02-04 Thread Søren gruby
I'm using the jQuery plugin: Validation.

How can I validate, say a textbox inside a specific div element that
has a specific id?

$(document).ready(function() {
$(#aspnetForm).validate({
rules: {
   txt_1: {
minlength: 2,
required: true
},
txt_2: {
required: true,
email:true
}
}, messages: {}
});
});

I have a textbox in a div with an id = testdiv and the above code
doesn't seem to locate the textbox.

Thanks


Re: [jQuery] “(validate)”

2010-02-04 Thread Nathan Klatt
On Thu, Feb 4, 2010 at 7:28 AM, Søren gruby mrgr...@gmail.com wrote:
 How can I validate, say a textbox inside a specific div element that
 has a specific id?

Validate validates forms so to validate a field, it has to be in a
form - doesn't matter whether it's in another div or what. Each rule
entry refers to a field's name.

From your example, it looks like you have a form with id=aspnetForm
but you don't specify what your input's name is; if it isn't txt_1 or
txt_2 then it won't be validated.

You can find some samples here:

http://jquery.bassistance.de/validate/demo/

Nathan


Re: [jQuery] (validate) Validation following server-side submit

2010-01-31 Thread Nathan Klatt
You might consider using the remote option:

http://jquery.bassistance.de/validate/demo/captcha/

Or, have onSubmit submit the form asynchronously and redirect if the
submit is successful.

In both cases you'll want to re-validate the submittal but if it's not
successful, who cares if you handle someone being an ass in a graceful
manner? :)

Nathan


[jQuery] (validate) Validation following server-side submit

2010-01-30 Thread Aaron Gusman
As you all know, validating on the client-side only can be easily
hijacked by disabling javascript.  For this type of validation I am
using the jquery validator plugin http://docs.jquery.com/Plugins/Validation.
When all client-side validations are successful, and the form is
submitted to the server, I reapeat the same validations on the
server.  But does any one of you know how I can invoke the client-side
validator of the client to show errors that have been detected on the
server?

Validating on the client side shows me nice error messages beneath
each input field and an error summary at the top.  But let's say I
want to validate the username field upon registration.  On the client
I check whether the field has been left empty or if it follows the
correct format but I cannot check if the username already exists.  I
can only check for such occurrence when the data arrives at the
server.

How can I show the same error layout after the submission takes place?

Thanks for your ideas.


[jQuery] Validate Paste Issue with ichars

2010-01-29 Thread Ahmad Bagadood
Hello geeks,

I've used your useful plugin to effectivly prevent typing in Arabic
charecters in a form using ichars function. However, this function
in this validation plugin has a bug. It allows pasting fobidden
charcters!

I believe an aditional check onblur might solve this bug.

Pls. advise on how and where to fix this.

Regards,
Ahmad Bagadood


[jQuery] (validate) namespace conflict w/ flowplayer tools?

2010-01-28 Thread shinronin
hi, i appear to be in the midst of troubleshooting a namespace
conflict of the $() function.  i'm using validate 1.4.  i've attempted
to use jQuery's noConflict() method, but i'm still missing something.

link href=/c/jq/ui.all.css rel=stylesheet type=text/css /
script src=http://cdn.jquerytools.org/1.1.2/full/
jquery.tools.min.js type=text/javascript/script
script src=/js/jquery.ui.core.js type=text/javascript/script
script src=/js/jquery.ui.tabs.js type=text/javascript/script
script src=/js/jquery.ui.accordion.js type=text/javascript/
script
script type=text/javascript
/* ![CDATA[ */
var $j = jQuery.noConflict();
/* ]] */
/script
script src=/js/cilp.js type=text/javascript/script
script src=/js/jquery.validate.js type=text/javascript/script
script src=/js/cilp/validate.js type=text/javascript/script

if i comment out the last two external references (the validate files)
all is well.  here is the validate.js file:

$j(function($) {
$j.extend( $.validator.messages, {
required: 'Required'
} );

$j( '#qotw-form' ).validate( {
rules: {
'qotw-options': 'required'
},

submitHandler: function() {
var answer = $j( input[name='qotw-options']:checked ).val
();
var correct = answer == 'c' ? true : false;
var res = correct ? 'Correct!' : 'Try again!';
$j( '#qotw-answer' ).html(res);
},

focusCleanup: true

//, debug: true
} );
} );

hopefully i'm doing something silly.  i just wish i knew an easy way
to namespace a given plugin to avoid this problem.  thanks for any
help!


[jQuery] (validate)

2010-01-25 Thread jhoin
This is a message to Jörn Zaefferer with respect to his autocomplete
plugin:

[This question was previously posted on StackOverFlow]

I am using the autocomplete functionality from JQuery and am having a
small problem. I have a div element with some text and a variable
number of input boxes that have autocomplete functionality. When a
user clicks on the text in the div element, the input boxes are
removed. Clicking on the text toggles between showing the input boxes
and not showing the input boxes. With each text click a php script is
called that returns new html text for the div element.

The autocomplete inputs are created with php code similar to the
following:

php code:

echo id='a' value='Smith' autocomplete='off';
echo script type=\text/javascript\$('a').autocomplete
('do_name_lookup.php',{minChars:3,max:999});/script;
echo script type=\text/javascript\$('a').result(function(event,
data, formatted) {alert(data[0])});/script;

On a static web page the two script statements would appear in the $
(document).ready function. Since my page is dynamic, however, the
input boxes are created a long time after the $(document).ready has
fired. Therefore, I have to execute the javascript code just after
each of the input boxes is made. This setup works fine the first time
the php code above is executed, but the second time the code is
executed, the autocomplete functionality goes away.

Can anyone explain to me why this is happening and how to work around
it? My suspician is that I am declaring a variable with the same name
multiple times and this is creating a conflict of some type.

Further refinement of question:  The problem (autocomplete stops
working) occurs when I dynamically remove an element (e.g., a table
row that contains an autocomplete input item) from my page.

It seems to me that I must unbind the input element, a in the
example above, but I am not sure how to do this properly.


[jQuery] (validate) block event Return

2010-01-24 Thread Vagner
Hi,
I'm trying to use the plugin Validator (from
http://bassistance.de/jquery-plugins/jquery-plugin-validation/) WITH
JSONSuggestBox (see: http://tomcoote.co.uk/jQueryJSONSuggestBox.aspx).

But when I press Return on a searched item (JSONSuggestBox), the
validate plugin starts, instead of let the callback function runs
(that update an input hidden with the id of the item founded).

How can I run thgough this?

Vagner


[jQuery] VALIDATE - How to access message in highlight function?

2010-01-24 Thread Temp
I am using the highlight/unhighlight options of the validator to add a
class to my invalid element, and I want to qtip the message. Can
someone please tell me how to access the error message of the element?


Re: [jQuery] (Validate) Checking once an Entry is Change

2010-01-20 Thread Scott Wilcox
Got it working now, but thanks!

Turned out my backend wasn't returning right. Human error we'll call it ;)

On 19 Jan 2010, at 20:22, Nathan Klatt wrote:

 On Sat, Jan 16, 2010 at 6:42 PM, Scott Wilcox sc...@tig.gr wrote:
 Pastebin of code: http://pastebin.com/ma643a4e
 
 Hiya Scott,
 
 What's the code at the other end look like - i.e., /api/check/existac?
 
 Nathan



smime.p7s
Description: S/MIME cryptographic signature


[jQuery] (validate) Select List

2010-01-19 Thread MarketAgent 007
I'm new to jQuery.  I would love some help with the following.

I'm using the validator plugin. Here is a description of what I'm
trying to validate.

Step 1 (required):

Select Vehicle Make.

select name=Vehicle Make class=required
   option value=ChevyChevy/option
   option value=FordFord/option
   option value=OtherOther/option
/select

Step 2a: (this is required if select is Chevy or Ford):

If Chevy or Ford, Select Vehicle Type.

select name=Vehicle Type
   optionSedan/option
   optionSUV/option
/select

Step 2b: (this is required if select is Other):

If Other please enter details:
input  type=text /
input  type=text /

The validation is working except when selecting Ford.  If Ford is
selected in step 1., Step 2a should be required.

I have a working demo here: http://www.ma007.com/test/index.html

Any help would be greatly appreciated!


[jQuery] (validate) Compatability with jQuery 1.4?

2010-01-19 Thread Anthony
Hi all,

We're planning on using Jörn Zaefferer's 'validate' plugin and
wondered if anyone knows if it is compatible with jQuery 1.4? Be very
intereseted to find out.

Many thanks.
Anthony.


Re: [jQuery] (Validate) Checking once an Entry is Change

2010-01-19 Thread Nathan Klatt
On Sat, Jan 16, 2010 at 6:42 PM, Scott Wilcox sc...@tig.gr wrote:
 Pastebin of code: http://pastebin.com/ma643a4e

Hiya Scott,

What's the code at the other end look like - i.e., /api/check/existac?

Nathan


[jQuery] Validate jquery plugin problem

2010-01-19 Thread Niagara
Hi guys,
i'm using  jQuery JavaScript Library v1.4 and   jQuery validation plug-
in 1.6
My code with  jQuery validation plug-in 1.5 work correctly, but with
the new version NO.

The JS:
$().ready(function() {
$(#registrazione).validate({
submitHandler: function() {
checkLock('registrazione','Sei sicuro di abitare fuori 
dall
\'italia?');
},
rules: {
nome_cognome:{
required:  true,
minlength: 3,
maxlength: 60,
},
username: {
required: true,
minlength: 3,
maxlength: 40,
remote: /metwit/comuni/action.php,
nowhitespace: true
},

password: {
required: true,
minlength: 5
},

email: {
required: true,
email: true,
remote: /metwit/comuni/action.php
},
localita: {
required: true
},
antispam_captcha: {
required: true,
remote: /metwit/comuni/action.php
},

agree: required
},
messages: {
nome_cognome:{
required: Inserisci la tua identità,
minlength: Minimo 3 parole,
maxlength: Massimo 60 parole
},
username: {
required: Inserisci un username.,
minlength: Minimo 3 lettere.,
maxlength: Lunghezza username massima 
superata.,
remote: Username in uso.,
nowhitespace: Inserisci solo caratteri e 
numeri.
},
password: {
required: Inserisci una password,
minlength: Minimo 5 lettere.
},
email: {
required: Inserisci un'email.,
email: Inserisci un'email valida.,
remote: Email in uso.
},
localita: {
required: Inserisci la località da cui 
segnali, selezionandola
dalla mappa sopra.
},
antispam_captcha: {
required: Inserisci il codice antispam.,
remote: Inserisci il codice antispam corretto.
},
agree: {
required: Devi accettare i termini del 
servizio.
}
}
});
});

The html:
form method=POST id=registrazione
table
tr
tdNome  Cognome/td
tdinput type=text name=nome_cognome/td
/tr
tr
tdUsername/td
tdinput type=text name=username/td
/tr
tr
tdPassword/td
tdinput type=password name=password/td
/tr
tr
tdEmail/td
tdinput type=text name=email/td
/tr
tr
tdMappa/td
tddiv id=map style=width:430px; 
height:385px; border:1px
solid black;/div/td
/tr
tr
tdDa dove fai le tue segnalazioni?/td
td
input type=text name=localita 
id=localita style=width:
400px;
input type=button id=centra 
value=Trova
onclick=G.centraLoc($('#localita').val());
brspanEs:Via del Sansovino, 50142 
Firenze, Italia (Puoi
trascinare il marker nella mappa nella località e via precisa in cui
abiti. ;-))/span
/td
/tr
tr
   

Re: [jQuery] Validate jquery plugin problem

2010-01-19 Thread Nathan Klatt
2010/1/19 Niagara keit...@libero.it:
 My code with  jQuery validation plug-in 1.5 work correctly, but with
 the new version NO.

In what way does it not work? False positives? False negatives?
Console errors or silent refusal? Help us to help you. ;)

Nathan


[jQuery] (validate) (remote) How to check a returning user without locking the submission?

2010-01-18 Thread PhilY
Hi there.
I'm working on a quiz where you can submit another time your answers
(yes, I want them to win ;-).
But if you do so, I'd like to display a warning that tells you that
you have already submitted and that your new submission will erase the
previous one.
I've used the remote feature on the 'name' field to check if a user
has already submitted : with success but then, the form is locked and
I can't submit until I fill an unplayed 'name'.

#1 So, can I use the remote feature to check a returning player but
still allowing that user to submit?


I hide my custom warning div at start and displays it if 'remote'
triggers.

#2 How can I hide that div if the user change its name?


Here is my script, thanks a lot for your advices :

$(document).ready(function(){
$(#alreadyplayed).hide(); // this is my div warning telling you
that you have already played
$(#formQuiz).validate({
rules: {
name: {
required: true,
remote: {
url: scripts/namecheck.php, // checks 
if 'name' has already
played
type: post
}
}
},
messages: {
name: {
required: required,
remote: function(){
$(#alreadyplayed).show(); // displays 
my custom div warning
return You already played! // display 
the regular 'remote'
error message
}
}
},
submitHandler: function(form) {
form.submit();
}
});
});


[jQuery] (validate) plugin

2010-01-18 Thread PhilY
Hi there.
I'm working on a quiz where you can submit another time your answers
(yes, I want them to win ;-).
But if you do so, I'd like to display a warning that tells you that
you have already submitted and that your new submission will erase the
previous one.
I've used the remote feature on the 'name' field to check if a user
has already submitted : with success but then, the form is locked and
I can't submit until I fill an unplayed 'name'.

#1 So, can I use the remote feature to check a returning player but
still allowing that user to submit?


I hide my custom warning div at start and displays it if 'remote'
triggers.

#2 How can I hide that div if the user change its name?


Here is my script, thanks a lot for your advices :

$(document).ready(function(){
$(#alreadyplayed).hide(); // this is my div warning telling you
that you have already played
$(#formQuiz).validate({
rules: {
name: {
required: true,
remote: {
url: scripts/namecheck.php, // checks 
if 'name' has already
played
type: post
}
}
},
messages: {
name: {
required: required,
remote: function(){
$(#alreadyplayed).show(); // displays 
my custom div warning
return You already played! // display 
the regular 'remote'
error message
}
}
},
submitHandler: function(form) {
form.submit();
}
});
});


[jQuery] (Validate) Checking once an Entry is Change

2010-01-16 Thread Scott Wilcox
Hi Folks, 

I have a form that uses remote validation to test whether a username exists. It 
fires fine, however when it should return false, nothing is showing next to an 
element. 

Also, when the text input is changed then it doesn't revalidate the field which 
it should do.

Any help, points or suggestions are welcome.

Pastebin of code: http://pastebin.com/ma643a4e

Scott.

smime.p7s
Description: S/MIME cryptographic signature


[jQuery] [validate] Error Labels don't remove after field is validated

2010-01-14 Thread Loony2nz
I am using jorn's awesome validation plugin for sometime.

Every now and then I get this issue.

Hit the submit button and the error messages pop up next to the
invalid field.  no problem.
I enter the correct data in the field and go to the next field.
Unfortunately, after the field is valid, the error message stays.
Some forms I have no issues with.  Some I do.

Anyone know why this happens?  The one in particular that is forcing
this post, is that the form is in a modal.  Not sure it's pertinent to
the issue, but just thought I'd put it out there.

Thanks!


[jQuery] (validate) Adding in custom validation

2010-01-08 Thread echuang, chew
Currently I am adding my custom validation (messages, rules) into
jquery.validate.js directly.
Anyone know how to adding in own customized validation into another js
file and if possible, make the jquery.validate.js UNTOUCH.


[jQuery] (validate) Problems with additional methods...

2010-01-07 Thread Andrea Puddu
Hello everybody!

I'm trying to use a custom method for validate one of my input's form,
but no way.

Neither the 'additional-methods.js' included in the plugin pack work
for me Seems to be ok,  but no idea.

This is a resume of my code:

-JAVASCRIPT-

script type=text/javascript
$.validator.setDefaults({
submitHandler: function() {
$(#cForm).ajaxSubmit({
url:'inc/request.php',
target: '#form-box',
success: function(){
return false;
},
resetForm: true
});
}
});

$(document).ready(function(){
$(#cForm).validate({
rules:{
nif: alphanumeric,
},
messages: {
nombre: campo obligatorio,
email: {
required: campo obligatorio,
email: email no valido
},
telefono: {
required: campo obligatorio,
digits: solo numeros
},
nif: campo obligatorio,
legal: campo obligatorio
},
errorElement: em,
errorPlacement: function(error, element) {
if ( element.is(:radio) )
error.appendTo(element.parent().parent());
else if ( element.is(:checkbox) )
error.appendTo(element.parent());
else
error.prependTo( element.parent() );
}
});
});
/script

-HTML-
...

form action= method=post id=cForm
div
label for=nombreNombre y Apellidos/label
input class=required type=text size=25
name=nombre id=nombre value= maxlength=100/
/div
div
label for=nifNIF/label
input class=required type=text size=9
name=nif id=nif value= maxlength=9/
/div
div
label for=telefonoTeléfono/label
input class=required digits type=text
size=10 name=telefono id=telefono value= maxlength=15/
/div
div
label for=emailE-mail/label
input class=required email type=text
size=25 name=email id=email value= maxlength=100/
/div
div class=row
input class=required name=legal id=legal
type=checkbox/
label for=legalHe leído y acepto las bases
legales/a/label
input type=submit name=submit id=send
value= /
/div
/form
...


Thanks in advance!

Best Regards,

Andrea


[jQuery] jQuery Validate dynamic form issues

2009-12-27 Thread Dave3
Hey all, this is my first post here. I have tried desperately for
hours and hours to find a solution to this problem but so far no
luck.

I have a dynamic form that will show/hide certain parts based on the
value of a select box. I am also using the errorContainer option to
display all errors together in a seperate div.

My problem is that the errorContainer is not hiding itself when there
are zero errors. I suspect this is because the numberOfInvalids is out
of wack with what is actually on the page. I am manually hiding errors
for form elements that no longer exist, which is causing the validate
plugin to become confused. If the validate plugin could validate
onChange of a select box that may help me out, but I haven't found a
way to make that happen.

Instead of writing a book about the issue I will just show you a
working example and maybe someone can help me out. There are 2 files
here, test-1-1.html and test-1-1.js. Not included are jquery and the
validate plugin.

The easiest way to observe the error is: select 1 borrower, click
submit, select 0 borrowers (Please Select)...

//---
test-1-1.js--//

$(document).ready(function(){

// form validation
$(form).validate({
debug: true,
onkeyup: false,
ignore: '.ignore',
rules:{
numBorrowers:{
notZero: true,
},
borrower1FName:{
required: true,
},
borrower1MName:{
required: true,
},
borrower1LName:{
required: true,
},
borrower2FName:{
required: true,
},
borrower2MName:{
required: true,
},
borrower2LName:{
required: true,
},
primaryContact:{
required: true,
},
},
messages:{
numBorrowers:{
notZero: 'Please choose the number of loan 
applicants.',
},
borrower1FName:{
required: 'Please enter Borrower 1\'s first 
name.',
},
borrower1MName:{
required: 'Please enter Borrower 1\'s middle 
name.',
},
borrower1LName:{
required: 'Please enter Borrower 1\'s last 
name.',
},
borrower2FName:{
required: 'Please enter Borrower 2\'s first 
name.',
},
borrower2MName:{
required: 'Please enter Borrower 2\'s middle 
name.',
},
borrower2LName:{
required: 'Please enter Borrower 2\'s last 
name.',
},
primaryContact:{
required: 'Please choose the primary contact 
for this loan.',
},
},
highlight: function(element){
$(element.form).find(label[for=+element.id +])
   .addClass('error');
},
unhighlight: function(element){
$(element.form).find(label[for= + element.id + ])
.removeClass('error');
},
errorContainer: #applicationErrorMessage,
errorLabelContainer: #applicationErrorMessage ul,
wrapper: li,
});

$.validator.addMethod(notZero, function(value){
if(value == 0)
return false;
else
return true;
});

// functions
function borrower1AddValidation(){
$('.borrower1').removeClass('ignore');
}
function borrower2AddValidation(){
$('.borrower2').removeClass('ignore');
}
function borrower1RemoveValidation(){
// remove validation
$('.borrower1').addClass('ignore');

// remove highlighting next to input
$('td  label[for^=borrower1]').removeClass('error');

// hide error msgs

[jQuery] VALIDATE - error labels don't disappear

2009-12-27 Thread Loony2nz
Using Jorn's awesome validator for the umpteenth time..I'm stumped on
this one issue I'm having.

I made a simple form

form name=testForm id=testForm method=get action=
Firstname input type=text name=firstname id=firstname
class=required /
br
Lastname input type=text name=lastname id=lastname
class=required /
br
input type=submit value=submit
/form

with a simple validation rule

$.validator.setDefaults({
submitHandler: function() { alert(submitted!); }
});
// FORM VALIDATION //
//Single Event Form
$(#testForm).validate();

The problem is that when I hit submit with nothing in the input
fields, I get the error message, but after I fulfill the first name
field, and tab to the last name field, the error message doesn't
disappear.  Even after I submit the valid form, the screen refreshes,
but the error label is still therei have a big ?? over my head
now.

Help.


[jQuery] JQuery Validate div selector issues

2009-12-23 Thread p...@scotche.gg
Hi Guys

I am trying to get validate to work, but I am soo close and yet soo
far!
I think the problem is the selector and way i append the error or
valid classes to the label, or specify the element for errors?

Can anyone see the mismatch or problem?

HTML example...
[code]div class=namedivCompany Name:/div
div class=textdiv
div class=inputdivinput name=CompanyName 
id=CompanyName
type=text  class=input-text/ value=?if(isset($this-
company_name)){ echo $this-company_name;};?/div
div class=inputrightdiv 
id=img_CompanyName/div
/div
div class=inputbottom-text 
id=error_CompanyName?php echo
$this-error_array['company_name']; ?/div
 [/code]

where the inputrightdiv is what holds my todo image,
then i want it replaced with inputrightdiv-valid which shows my nice
green tick image!

Jquery Validation initialization( i have taken out extra options for
simplicity )...

[code]
script
$(document).ready(function() {
// validate signup form on keyup and submit
var validator = $(#recruiter_signup).validate({
rules: {
CompanyName: required

},
messages: {
CompanyName: Please ensure you have entered your 
company name.


},
// the errorPlacement has to take the table layout into account
errorPlacement: function(error, element) {
error.appendTo(element.parent().parent());

},
// Set Error Element
errorElement: div.inputrightdiv,
// Focus in textbox
focusInvalid: false,// show all form error at a time
// Set Error Class
//errorClass: error,
errorClass:inputrightdiv-error,
// specifying a submitHandler prevents the default submit, good 
for
the demo
submitHandler: function() {
alert(submitted!);
},
// set this class to error-labels to indicate valid fields
success: function(label) {

 label.addClass('inputrightdiv-valid');

}
});
});
/script[/code]

thanks for any tips or eagle eyes :)


[jQuery] Re: JQuery Validate div selector issues

2009-12-23 Thread scotchegg
one issue to add :)

I want the message text in the div inputbottom-text, but also on error
update or replace the inputrightdiv with inputrightdiv-valid , as this
class has my green tick.
Is it possible to alter a div class on error, but place error text
into another div?

thanks again for any help.

On Dec 23, 6:34 pm, p...@scotche.gg p...@scotche.gg wrote:
 Hi Guys

 I am trying to get validate to work, but I am soo close and yet soo
 far!
 I think the problem is the selector and way i append the error or
 valid classes to the label, or specify the element for errors?

 Can anyone see the mismatch or problem?

 HTML example...
 [code]div class=namedivCompany Name:/div
                         div class=textdiv
                                 div class=inputdivinput 
 name=CompanyName id=CompanyName
 type=text  class=input-text/ value=?if(isset($this-company_name)){ 
 echo $this-company_name;};?/div

                                 div class=inputrightdiv 
 id=img_CompanyName/div
                         /div
                         div class=inputbottom-text 
 id=error_CompanyName?php echo
 $this-error_array['company_name']; ?/div
          [/code]

 where the inputrightdiv is what holds my todo image,
 then i want it replaced with inputrightdiv-valid which shows my nice
 green tick image!

 Jquery Validation initialization( i have taken out extra options for
 simplicity )...

 [code]
 script
 $(document).ready(function() {
         // validate signup form on keyup and submit
         var validator = $(#recruiter_signup).validate({
                 rules: {
                         CompanyName: required

                 },
                 messages: {
                         CompanyName: Please ensure you have entered your 
 company name.

                 },
                 // the errorPlacement has to take the table layout into 
 account
                 errorPlacement: function(error, element) {
                         error.appendTo(element.parent().parent());

                 },
                 // Set Error Element
                 errorElement: div.inputrightdiv,
                 // Focus in textbox
                 focusInvalid: false,    // show all form error at a time
                 // Set Error Class
                 //errorClass: error,
                 errorClass:inputrightdiv-error,
                 // specifying a submitHandler prevents the default submit, 
 good for
 the demo
                 submitHandler: function() {
                         alert(submitted!);
                 },
                 // set this class to error-labels to indicate valid fields
                 success: function(label) {

                          label.addClass('inputrightdiv-valid');

                 }
         });});

 /script[/code]

 thanks for any tips or eagle eyes :)


[jQuery] (validate) - Documentation fix for highlight/unhighlight

2009-12-21 Thread dirk
Hi there,

When overriding the highlight/unhighlight methods, the examples
provided in the documentation will not work:
http://docs.jquery.com/Plugins/Validation/validate#toptions

They should instead read:
 highlight: function( element, errorClass, validClass ) {
   $(element).addClass(errorClass).removeClass(validClass);
 },
 unhighlight: function( element, errorClass, validClass ) {
   $(element).removeClass(errorClass).addClass(validClass);
 }

Thanks,
Dirk


[jQuery] jquery validate plugin - greaterThan addmethod problem

2009-12-20 Thread markstegg...@googlemail.com
Hello,

So, I am using two custom methods, GreaterThan and LesserThan:

// custom code to for greater than
jQuery.validator.addMethod('greaterThan', function(value, element,
param) {
return ( value  jQuery(param).val() );
}, 'Must be greater than start' );

// custom code for lesser than
jQuery.validator.addMethod('lesserThan', function(value, element,
param) {
return ( value  jQuery(param).val() );
}, 'Must be less than end' );

Then, in the validation rules I have:

aupairLongStay: {required:true, greaterThan: #aupairShortStay},
aupairShortStay: {required:true, lesserThan: #aupairLongStay},


I'm trying to use them to test two select boxes against each other...
making sure one is less than the other but it doesn't work properly...
any ideas?


[jQuery] Validate Form - how to do NotEqualTo

2009-12-18 Thread jc_2009
I'm using Jörn Zaefferer's Jquery Form Validation which is great.

However, I needed one extra method/function.

I have some fields which initially have values (e.g. see below)

input type=text name=First Name id=First Name value=Enter Name
Here * /

So for the validation if the Input First Name's value is equal to
Enter Name Here*, this should then be marked as not true therefore
displaying an error mssg and preventing form from being submitted.

Any help would be much appreciated.



[jQuery] (validate) condition subsets (multiple submit buttons)

2009-12-17 Thread Jacob
(abstract)

So, I have a form with multiple submit buttons. The different
submission types require different subsets of data input within a
single form, and therefore have different requirements as to what is
required. All of the examples for the validation plugin involve all
values in a form being validated on the form's submission.

I made an object of the following form to specify what validations
should occur dependent on the submit button.

{
  name of form(1...N): {
name of submit-button(1...N): {
  name of field(1...N) {
[validation conditions]
  }
}
  }
}

I want to validate on submission, but I've come to a mind circus about
how to accomplish that. Essentially I want to mark fields as required
depending on whether the validation event was triggered by a specific
submit button. I'll probably end up creating crafty closure code to
work through this, but I believe this would probably be useful as a
use case for future development.


[jQuery] (validate) jQuery Validate + CKEditor

2009-12-16 Thread Rodolfo Pereira
When I use the jQuery Validate with the CKEditor, i need to submit the
form twice for validate de textarea that use CKEditor.

Why this happens?


[jQuery] (validate)

2009-12-16 Thread eimantas
Hi guys

I'm having trouble with validation plugin from bassistance.de. I have
custom handlers for errorPlacement, highlight and unhighlight events.
I also have defined custom errorElement. Error messages and validation
data is extracted via metadata plugin using html5 data-* attributes.

The problem is that if I define custom errorClass (which i need for
error message elements), the error gets added each time the field is
unfocused and left blank after first validation. For example:

1) I open form and try to submit it;
2) Errors are displayed;
3) I focus/blur errored field;
4) the error for that field is added again;

Any help would be appreciated without disclosing lots of mine code .)

Thank you in advance for taking time to answer my call for help!


Re: [jQuery] (validate)

2009-12-16 Thread Jörn Zaefferer
Without seeing any of your code is pure guesswork to help you find the
issue. I need to see at least the code configuring the validation plugin.

Jörn

2009/12/16 eimantas enc.c...@gmail.com

 Hi guys

 I'm having trouble with validation plugin from bassistance.de. I have
 custom handlers for errorPlacement, highlight and unhighlight events.
 I also have defined custom errorElement. Error messages and validation
 data is extracted via metadata plugin using html5 data-* attributes.

 The problem is that if I define custom errorClass (which i need for
 error message elements), the error gets added each time the field is
 unfocused and left blank after first validation. For example:

 1) I open form and try to submit it;
 2) Errors are displayed;
 3) I focus/blur errored field;
 4) the error for that field is added again;

 Any help would be appreciated without disclosing lots of mine code .)

 Thank you in advance for taking time to answer my call for help!



[jQuery] jquery validate bug

2009-12-15 Thread Givan
Hi, I found a bug within the validation plugin
I have a form and I need to click the submit button twice to submit
the form.
It seems that on the first click validates and only on the second
click will submit the form.
I think it must submit the form directly if there is no validation
error.

A small example can be found here

http://www.codeassembly.com/files/validate-bug.zip

Thanks.


Re: [jQuery] jquery validate bug

2009-12-15 Thread Leonardo K
I download your code and it's working fine.

On Tue, Dec 15, 2009 at 08:48, Givan giv...@gmail.com wrote:

 Hi, I found a bug within the validation plugin
 I have a form and I need to click the submit button twice to submit
 the form.
 It seems that on the first click validates and only on the second
 click will submit the form.
 I think it must submit the form directly if there is no validation
 error.

 A small example can be found here

 http://www.codeassembly.com/files/validate-bug.zip

 Thanks.



[jQuery] Re: jquery validate bug

2009-12-15 Thread Givan
Sorry, I didn't give you enough details.
The validation of the form elements are are made on onblur event, if
you don't click outside the last textarea then that field will not be
validated.
When you click on the submit form when editing the last textarea the
onblur event is triggered but the normal submit action is ignored and
you need to click again on the submit button.
It works only if you first click somewhere outside the textarea then
click on the button, but if you don't leave the textarea and click
directly it will not work.


On Dec 15, 6:04 pm, Leonardo K leo...@gmail.com wrote:
 I download your code and it's working fine.

 On Tue, Dec 15, 2009 at 08:48, Givan giv...@gmail.com wrote:
  Hi, I found a bug within the validation plugin
  I have a form and I need to click the submit button twice to submit
  the form.
  It seems that on the first click validates and only on the second
  click will submit the form.
  I think it must submit the form directly if there is no validation
  error.

  A small example can be found here

 http://www.codeassembly.com/files/validate-bug.zip

  Thanks.


[jQuery] validate - error messages keep piling up

2009-12-15 Thread Mark Livingstone
Hi,

Since I moved to a new design I cannot figure out how to stop the
validate plug-in to append error messages and instead have it remove
the previous error message before creating another one.

here is what my HTML code looks like with multiple error messages:

p
label for=email
E-mail
/label
  input class=text-input medium-input input-notification error
png_bg name=client[email] id=email value={EMAIL} size=25
span class=errorValidate generated=true htmlfor=email
This field is mandatory
/span
span class=errorValidate generated=true htmlfor=email
This field is mandatory
/span
span class=errorValidate generated=true htmlfor=email
This field is mandatory
/span
span class=errorValidate generated=true htmlfor=email
This field is mandatory
/span
span class=errorValidate generated=true htmlfor=email
Please enter a valid e-mail address
/span
/p

CSS:

.errorValidate {
padding: 2px 0 2px 22px;
margin: 0 0 0 5px;
}

JS:

var validateForm = $(#clientUpdateForm).validate(
{
   errorClass: errorValidate,
   /etc/...
}

Any ideas why it would do that?

Thanks in advance!


[jQuery] Re: (Jquery Validate) Keep getting an error in IE8

2009-12-14 Thread snobo
I stumbled upon the same shit, and this is how IE8 reacts on OPTION
tags without value specified (like, optionblahblah/option). Until
jQuery is fixed to support it (and in my case I must stick to old
version 1.2.6, so fix is impossible) the workaround is to always use
option value=blahblahblahblah/option notation, if possible. Of
course it's not a generic solution, but might help someone.

On Nov 23, 4:55 pm, djseng dave.s...@gmail.com wrote:
 I'm getting this same error. Does anyone have a patch for it?

 On Nov 7, 9:31 pm, chobo2 howser_...@hotmail.com wrote:



  Hi

  I don't know what is going but my jqueryvalidateplugin(1.5.5) is not
  working and I am not sure for how long since I do most of my testing
  on firefox.

  The problem is this I go to one of my forms that jqueryvalidateon it
  and hit my create button my validation kicks in as it should and
  does this right in all browsers includingIE8. Now where it does not
  work is when I do this.

  I choose the first dropdown list and choose something. Then hit
  create now all validation errors should show up expect the one for
  the first dropdown box.

  It does this in all browsers except in IE 8. I get this

   Webpage error details

   User Agent: Mozilla/4.0 (compatible;
   MSIE 8.0; Windows NT 6.1; Win64; x64;
   Trident/4.0; .NET CLR 2.0.50727;
   SLCC2; .NET CLR 3.5.30729; .NET CLR
   3.0.30729; Media Center PC 6.0; Tablet PC 2.0) Timestamp: Sun, 8 Nov 2009
   03:26:08 UTC

   Message: Object required Line: 890
   Char: 5 Code: 0 URI:
  http://localhost:3668/Scripts/Plugins-Development/jquery.validate.js

  This is what is on line 890

      return options.length  0  ( element.type == select-multiple
  || ($.browser.msie  !(options[0].attributes['value'].specified) ?
  options[0].text : options[0].value).length  0);

  This like the whole method block.

          methods: {

                  //http://docs.jquery.com/Plugins/Validation/Methods/required
                  required: function(value, element, param) {
                          // check if dependency is met
                          if ( !this.depend(param, element) )
                                  return dependency-mismatch;
                          switch( element.nodeName.toLowerCase() ) {
                          case 'select':
                                  var options = $(option:selected, element);
                                  return options.length  0  ( element.type 
  == select-multiple
  || ($.browser.msie  !(options[0].attributes['value'].specified) ?
  options[0].text : options[0].value).length  0);
                          case 'input':
                                  if ( this.checkable(element) )
                                          return this.getLength(value, 
  element)  0;
                          default:
                                  return $.trim(value).length  0;
                          }
                  },

  Not sure what is going on.


[jQuery] validate (help with plugin)

2009-12-14 Thread Scott Phillips
I am trying to get the validate plugin (http://docs.jquery.com/Plugins/
Validation) to work with my forms, but all I seem to be able to
produce is errors My code looks like this (I've commented out
where I was trying to add it):

$(function () {

//$(#loginForm).validate({
$(#loginForm).submit(function(){
dataString = $(#loginForm).serialize();
$(.statusMessage).html('Working...').addClass('ui-state-
highlight').fadeTo(fast,1);
$.ajax({
type: POST,
url: /usr/ajaxlogin.php,
data: dataString,
dataType: json,
success: function(data,textStatus) {
if(data.status == stop){
$(.statusMessage).html(Sorry:  +
data.message).addClass('ui-state-error').fadeTo(fast,1);
}

if(data.status == go){
$(.statusMessage).html(div
class='errorMessage'  + data.message).addClass('ui-state-
error').fadeTo(fast,1);
window.location.href=data.url;
}

},
timeout:3000,
error: function (XMLHttpRequest, textStatus, errorThrown)
{
$(.statusMessage).html('We have encountered an
error, please notify support or try again.').addClass('ui-state-
error').fadeTo(fast,1);
}
}); // end .ajax

return false;

}); // end form submit func.

//});

}); // End Ready Func.


[jQuery] validate australian date

2009-12-14 Thread buRn
Hi does anyone know how to validate australian date?  I only have the
normal date validation and want to have the month and day switch
around.

cheers
bUrn


Re: [jQuery] validate australian date

2009-12-14 Thread Dhruva Sagar
Check out www.datejs.com it's a great library to deal with any kinds of
dates

Thanks  Regards,
Dhruva Sagar.




On Tue, Dec 15, 2009 at 8:49 AM, buRn bgen...@gmail.com wrote:

 Hi does anyone know how to validate australian date?  I only have the
 normal date validation and want to have the month and day switch
 around.

 cheers
 bUrn



[jQuery] [validate] show status indicator while conducting a remote validation

2009-12-11 Thread Marc
Hi,
  I was wondering if it's possible to show an icon or label while the
Validate plugin (http://docs.jquery.com/Plugins/Validation) is waiting
on the response from a Remote rule. Ideally I would like to show a
progress indicator to inform the user that the element is being
validated in case of a slow connection or slow server response time.


cheers,

Marc.


Re: [jQuery] [validate] show status indicator while conducting a remote validation

2009-12-11 Thread Jörn Zaefferer
The plugin currently doesn't provide any callbacks for that, but you can use
jQuery's ajax events: http://docs.jquery.com/Ajax_Events

Jörn

On Fri, Dec 11, 2009 at 1:27 AM, Marc marc.ga...@gmail.com wrote:

 Hi,
  I was wondering if it's possible to show an icon or label while the
 Validate plugin (http://docs.jquery.com/Plugins/Validation) is waiting
 on the response from a Remote rule. Ideally I would like to show a
 progress indicator to inform the user that the element is being
 validated in case of a slow connection or slow server response time.


 cheers,

 Marc.



[jQuery] validate

2009-12-09 Thread Marcuus
Hi

I am using validation plugin with a submodal dialogue form.

It works really well except on the second time into the form the
validate() always returns true.

Do I need to reset the form (or something)

Regards
Mark


Re: [jQuery] [validate] - jquery plugin + recaptcha = anyone get this to work?

2009-12-07 Thread Carlos De Oliveira
This is a JQuery Forum.


[jQuery] Validate with accordian?

2009-12-07 Thread gtlitc
I have a website questionnaire/website planner that I intent to use
with prospective clients.
You can view it under development here: 
http://www.smallblue.net/questionnaire.html

The form is split in to sections and want to use an accordian effect
so that ony 1 section is visible at a time.
At the moment if some of the fields dont pass validation the user has
no feedback because that section might be closed so the user cant see
where the errors are.

What I would like to achieve is so that on Submit the first section in
which errors ocour is opened.
Or is there a better alternative concept do you think?
Perhaps change section titles to red on sections with errors?
If so how...

Perhaps I could keep an example of the validation+accordian example
on my server as an example that others could view.

Any ideas/help greatly received.

Thanks.


[jQuery] [validate] remote validation on empty field

2009-12-06 Thread david
Hi all,

I want to make a remote validation on an empty field. Sometimes the
field may be empty and sometimes not. This depends on the selection of
other elements. I send them with the data hash of the remote method.
The response should be written next to the empty field.
As i understand, by default an empty field is not validated(this is a
feature), but how may i force the plugin to make it ?

Thanks,
David


[jQuery] [validate] remote validations with two depending text boxes

2009-12-06 Thread david
Hi all,

I have a for two text boxes. They are one entity for a check. I check
the two text boxes together. I made it in the following way that i
added for both of them one class and added a rule. My problem is the
following. I have text-box a and textbox b. For a certain value of
textbox a textbox b shouldn't be empty. So i fill in the text-box a
and the remote validation works, and an error message is shown. When
afterward i fill an value in text-box b, the error message from
textbox a does not go away, which is bad.
What can i do ?

Thanks ,
David


[jQuery] [validate] - jquery plugin + recaptcha = anyone get this to work?

2009-12-06 Thread Loony2nz
I've seen the validation method for captha at this URL:
http://jquery.bassistance.de/validate/demo/captcha/

just wondering if anyone has gotten this to work with reCaptcha?

I'm having a #$*( of a time to get this to validate with
reCaptcha...any help is much appreciated.



Re: [jQuery] [validate] Error using rules('remove')

2009-12-05 Thread Jörn Zaefferer
The rules method applies to individual elements, not the whole form. Call it
directly on the age-field, and it should work.

Jörn

On Fri, Dec 4, 2009 at 1:34 PM, Eva eva.villarr...@gmail.com wrote:

 Hi all,

 I get an error when using rules('remove') from Jörn Zaefferer's
 Validate plugin.

 The error is:

 elem is undefined
 [Break on this error] var id = elem[ expando ];\r\n

 The code is:

 !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
http://www.w3.org/TR/html4/loose.dtd;
 html
 head
  script src=http://code.jquery.com/jquery-latest.js;/script

  script
  $(document).ready(function(){
$(#myform).validate({
rules: {
'fname': required,
'lname': { required: true }
  },
  messages: {
'fname': Name is required,
'lname': Lastname is required
  },   errorLabelContainer: #messageBox,
   wrapper: li,
   submitHandler: function() { alert(Submitted!) }
 })
  });
  /script

  script
function change() {
alert('changing rules');
$(#myform).rules('remove');
$(#myform).rules('add', {
'age': {
required : true,
messages : {
 required: Age required}
 }
 }
  );
}
  /script

 /head
 body
  script type=text/javascript src=http://dev.jquery.com/view/trunk/
 plugins/validate/jquery.validate.jshttp://dev.jquery.com/view/trunk/%0Aplugins/validate/jquery.validate.js
 /script
 ul id=messageBox/ul
  form id=myform action=/login method=post
   labelFirstname/label
   input name=fname /
   labelLastname/label
   input name=lname /
   labelAge/label
   input name=age /
   labelAdress/label
   input name=address /
   br/
   input type=submit value=Submit/
   input type=submit value=Other Submit onclick=change();/
  /form
 /body
 /html


 I've missed something or it's a bug in the plugin?

 Thanks in advance.




Re: [jQuery] Validate - date() Question from plug-in via bassistance.de

2009-12-05 Thread Jörn Zaefferer
Its been an outstanding issue for a long time. There are too many possible
approaches to tackle it, and I couldn't yet decide on one to implement. Date
parsing and validating is something I'd rather see in an extra library, with
a leightweight custom method for the validate plugin to delegate to it.
datejs was an option, but it would add quite a lot of overhead...

Suggestions are welcome.

Jörn

On Tue, Dec 1, 2009 at 3:41 PM, Eclectic Mix eclectic...@gmail.com wrote:

 The plug-in validates for the correct date format, but does not
 validate the date itself (2/31/2009 shows as valid).  Will this be
 added at some point or should I use another plug-in to validate the
 date.

 Thanks -

 george



[jQuery] Re: jQuery Validate and Dialog Confirm. submit() not working.

2009-12-05 Thread spud
I have not written up a test to verify this, but I suspect that your
problems is that the code following Ok is calling submit() on a full
jQuery object of the form -- which has the validation script attached
to it, so it gets caught in an endless loop.

What you really want to do is to call the submit() function on the
FORM itself, not the jQuery object containing the form.

So

$(purchase_credit).get(0).submit()

should do the trick. The get(0) returns the plain DOM version of the
form, so it no longer has any validation stuff attached to it.

The fact that, with jQuery,

$(form).submit()
and
form.submit()

don't always behave identically is a bit confusing...

spud.


[jQuery] [validate] Error using rules('remove')

2009-12-04 Thread Eva
Hi all,

I get an error when using rules('remove') from Jörn Zaefferer's
Validate plugin.

The error is:

elem is undefined
[Break on this error] var id = elem[ expando ];\r\n

The code is:

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
http://www.w3.org/TR/html4/loose.dtd;
html
head
  script src=http://code.jquery.com/jquery-latest.js;/script

  script
  $(document).ready(function(){
$(#myform).validate({
rules: {
'fname': required,
'lname': { required: true }
  },
  messages: {
'fname': Name is required,
'lname': Lastname is required
  },   errorLabelContainer: #messageBox,
   wrapper: li,
   submitHandler: function() { alert(Submitted!) }
})
  });
  /script

  script
function change() {
alert('changing rules');
$(#myform).rules('remove');
$(#myform).rules('add', {
'age': {
required : true,
messages : { required: 
Age required}
 }
 }
  );
}
  /script

/head
body
  script type=text/javascript src=http://dev.jquery.com/view/trunk/
plugins/validate/jquery.validate.js/script
ul id=messageBox/ul
 form id=myform action=/login method=post
   labelFirstname/label
   input name=fname /
   labelLastname/label
   input name=lname /
   labelAge/label
   input name=age /
   labelAdress/label
   input name=address /
   br/
   input type=submit value=Submit/
   input type=submit value=Other Submit onclick=change();/
 /form
/body
/html


I've missed something or it's a bug in the plugin?

Thanks in advance.



[jQuery] validate

2009-12-04 Thread sucheta
Hello all,

I am using the JQuery validator  from 
http://bassistance.de/jquery-plugins/jquery-plugin-validation/
. And I am using the calandar component from YUI.

The problem is similar to what bobbykjack has .

I have an input field ,when user clicks into it the calendar pops up.
When user chooses a date it fills the input box. But the error message
which had been displayed on clicking the submit button before the
field was filled  does not go away.

How do I get rid off it?.

Thanks in advance .
Sucheta


[jQuery] validate - How to dynamically set required:true to required:false

2009-12-03 Thread Ken
I am dynamically changing the className from required:true to
required:false but jquery.validate.js always is displaying that this
field is required.

function change_required(id,bRequired) {
document.getElementById(id).className=
(bRequired?'{required:true}':'{required:false}')
}

Before submit I see that input fields whose className is dynamically
set to {required:false} is still be treated by jquery.validate.js as
if  {required:true}

This is the call to validate for the form:
jQuery(document).ready(function() {
jQuery(#form_id).validate(
{
  errorClass: form_error,
  errorElement: div,
  wrapper: span
});
})

How do I set a rule to ONLY validate when the className has
required:true?


[jQuery] [validate]

2009-12-02 Thread 123gotoandplay
Hi,

I am trying to validate some dynamic generated input fields, like so

$(#form1).validate({
rules: {
$([name^=eventlink]) : {
required: true,
url: true
}
}

The input fields have the word eventlink in common, unfort this
doesn't work


Re: [jQuery] [validate]

2009-12-02 Thread Dhruva Sagar
Are you using some validate plugin ?

If you are doing so, you need to ensure that you execute your code only
after the dynamically generated fields have been generated OR you do it
everytime your dynamically generated fields are being generated.

For ordinary events, there is this 'live' function that jQuery provides
which enables you to be able to bind events even to such dynamically
generated nodes, but I am not sure if you can make use of that for this
validate() call.

Thanks  Regards,
Dhruva Sagar.




On Wed, Dec 2, 2009 at 3:21 PM, 123gotoandplay wesweatyous...@gmail.comwrote:

 Hi,

 I am trying to validate some dynamic generated input fields, like so

 $(#form1).validate({
rules: {
$([name^=eventlink]) : {
required: true,
url: true
}
}

 The input fields have the word eventlink in common, unfort this
 doesn't work



Re: [jQuery] [validate]

2009-12-02 Thread Mukesh Kumar
pata nhi yaar mujhe nhi malum


[jQuery] validate

2009-12-01 Thread tom
I'm using the jquery.validation plugin by Jörn Zaefferer and I was
wondering whether there's a easy way to trim form elements before they
are validated.

For example, if I'm validating a email address: t...@test.com   
using the email : true rule, it'll display an error because the
trailing whitespace is invalidating the email format. I was hoping I
could chain jQuery.trim(value) before the validation so the
whitespace is removed and the validation error never occurs?

Disclaimer: The jquery.validation plugin documentation page currently
isn't working (http://docs.jquery.com/Plugins/Validation) so I can't
RTFM.


Re: [jQuery] validate

2009-12-01 Thread Leonardo K
you can create your own method using the addMethod (
http://docs.jquery.com/Plugins/Validation/Validator/addMethod)

On Tue, Dec 1, 2009 at 11:50, tom thomasfothe...@googlemail.com wrote:

 I'm using the jquery.validation plugin by Jörn Zaefferer and I was
 wondering whether there's a easy way to trim form elements before they
 are validated.

 For example, if I'm validating a email address: t...@test.com   
 using the email : true rule, it'll display an error because the
 trailing whitespace is invalidating the email format. I was hoping I
 could chain jQuery.trim(value) before the validation so the
 whitespace is removed and the validation error never occurs?

 Disclaimer: The jquery.validation plugin documentation page currently
 isn't working (http://docs.jquery.com/Plugins/Validation) so I can't
 RTFM.



[jQuery] Validate - date() Question from plug-in via bassistance.de

2009-12-01 Thread Eclectic Mix
The plug-in validates for the correct date format, but does not
validate the date itself (2/31/2009 shows as valid).  Will this be
added at some point or should I use another plug-in to validate the
date.

Thanks -

george


Re: [jQuery] Validate: a question about the Remote option

2009-12-01 Thread Juan Ignacio Borda

you have to actually echo the result of validation: true or false

 Original Message 

Hello everyone,

I'm still dealing with that signup form.
Now I'd like to check with an Ajax call if a login is already taken.
That's what I'm doing:

$(#signup).validate( {
rules: {
ulogin: {
required: true,
// It's a custom method checking a regexp, it's working
login: true,
rangelength: [3,20],
remote: check.php?w=1
},
   ...

Here's the check.php file:

// Including the connection file, blah blah
...
$valid=true;
// Since I'm planning to use this file as a multipurpose script,
//preventing it from stop working
if (!isset($_REQUEST['w'])) $_REQUEST['w']=1;
if ($_REQUEST['w']==1) {
// If the login is taken, it will return something 0
$number=mysql_num_rows(mysql_query(SELECT `Id` FROM `Users` WHERE 
`Login`='.$_REQUEST['ulogin'].', $link));
if ($number0) $valid=false; else $valid=true;
}
After I validate, it stops working: it says incorrect for all fields
after the second submit. After the first submit it says nothing, even
that the login is already taken.
What's wrong?
Thanks!

  



attachment: juanignacioborda.vcf

[jQuery] Re: jQuery Validate using input type=image

2009-11-30 Thread Rich
Thanks that does pass the required value but I'll need to play around
with styling the button as I don't want the image to appear as an icon
and not as a button.

Thanks

On Nov 27, 5:20 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com
wrote:
 The plugin handles that case, though only for type=submit. You could try
 using a button instead:

 button type=submitimg ... //button

 JörnOn Fri, Nov 27, 2009 at 12:52 PM, Rich reholme...@googlemail.com wrote:
  I am validating a form that is submitted by an image input (input
  type=image), there are 3 of these inputs which either publish, save or
  delete the form details. If I turn javascript off and submit the form
  I can pick up the value of the input button used. i.e. request.form
  (publish.x) = ?, if I turn javascript on and use the jQuery validate
  plugin it does everything excpet pass the value of the button pressed
  so I can't detect which button has been pressed. Any help appreciated.

  [code]
  $(function() {
         $(#vml_library).validate({
                 ignore: input[type=hidden],
                 rules: {
                         mName: {
                                 required: true
                         },
                         mSummary: {
                                 maxlength: 200
                         },
                         mDescription: {
                                 required: true
                         },
                         mFile: {
                                 required: true,
                                 accept:
  +$(input[name=typeList]).val().replace(/\'/g,
  '').replace(/\./g, '').replace(/,/g, '|') +
                         },
                         tFile: {
                                 required: function(element) {
                                         return $(input[name=vType]).val()
   1;
                                 },
                                 accept: true
                         }
                 },
                 messages: {
                         mName: {
                                 required: Required
                         },
                         mFile: {
                                 required: Required,
                                 accept: Invalid File, must be  +
  $(input[name=typeList]).val()
                         },
                         mSummary: {
                                 maxlength: You may not use anymore than 200
  characters
                         },
                         mDescription: {
                                 required: Required
                         },
                         tFile: {
                                 required: Required,
                                 accept: Invalid File, must be '.jpg',
  '.jpeg', '.gif' or '.png'
                         }
                 },
                 success: function(label) {
                         label.addClass(valid).text(OK!);
                 },
                 highlight: function(element, errorClass) {
                         $(element).addClass(errorInput);
                 },
                 unhighlight: function(element, errorClass) {
                         $(element).removeClass(errorInput);
                 },
                 submitHandler: function(form) {
                         ShowProgress();
                         form.submit();
                 }
         });

  });
  [/code]

Re: [jQuery] Re: jQuery Validate using input type=image

2009-11-30 Thread Jörn Zaefferer
Styling buttons is quite flexible. Start with border:none, the rest should
be easy.

Jörn

On Mon, Nov 30, 2009 at 12:51 PM, Rich reholme...@googlemail.com wrote:

 Thanks that does pass the required value but I'll need to play around
 with styling the button as I don't want the image to appear as an icon
 and not as a button.

 Thanks

 On Nov 27, 5:20 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com
 wrote:
  The plugin handles that case, though only for type=submit. You could
 try
  using a button instead:
 
  button type=submitimg ... //button
 
  JörnOn Fri, Nov 27, 2009 at 12:52 PM, Rich reholme...@googlemail.com
 wrote:
   I am validating a form that is submitted by an image input (input
   type=image), there are 3 of these inputs which either publish, save or
   delete the form details. If I turn javascript off and submit the form
   I can pick up the value of the input button used. i.e. request.form
   (publish.x) = ?, if I turn javascript on and use the jQuery validate
   plugin it does everything excpet pass the value of the button pressed
   so I can't detect which button has been pressed. Any help appreciated.
 
   [code]
   $(function() {
  $(#vml_library).validate({
  ignore: input[type=hidden],
  rules: {
  mName: {
  required: true
  },
  mSummary: {
  maxlength: 200
  },
  mDescription: {
  required: true
  },
  mFile: {
  required: true,
  accept:
   +$(input[name=typeList]).val().replace(/\'/g,
   '').replace(/\./g, '').replace(/,/g, '|') +
  },
  tFile: {
  required: function(element) {
  return
 $(input[name=vType]).val()
1;
  },
  accept: true
  }
  },
  messages: {
  mName: {
  required: Required
  },
  mFile: {
  required: Required,
  accept: Invalid File, must be  +
   $(input[name=typeList]).val()
  },
  mSummary: {
  maxlength: You may not use anymore than
 200
   characters
  },
  mDescription: {
  required: Required
  },
  tFile: {
  required: Required,
  accept: Invalid File, must be '.jpg',
   '.jpeg', '.gif' or '.png'
  }
  },
  success: function(label) {
  label.addClass(valid).text(OK!);
  },
  highlight: function(element, errorClass) {
  $(element).addClass(errorInput);
  },
  unhighlight: function(element, errorClass) {
  $(element).removeClass(errorInput);
  },
  submitHandler: function(form) {
  ShowProgress();
  form.submit();
  }
  });
 
   });
   [/code]



[jQuery] Re: jQuery Validate using input type=image

2009-11-30 Thread Rich
yep, all done thanks - setting background-color: transparent; was the
key to getting it look perfect!

Thanks for your help.

Richard

On Nov 30, 11:57 am, Jörn Zaefferer joern.zaeffe...@googlemail.com
wrote:
 Styling buttons is quite flexible. Start with border:none, the rest should
 be easy.

 JörnOn Mon, Nov 30, 2009 at 12:51 PM, Rich reholme...@googlemail.com wrote:
  Thanks that does pass the required value but I'll need to play around
  with styling the button as I don't want the image to appear as an icon
  and not as a button.

  Thanks

  On Nov 27, 5:20 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com
  wrote:
   The plugin handles that case, though only for type=submit. You could
  try
   using a button instead:

   button type=submitimg ... //button

   JörnOn Fri, Nov 27, 2009 at 12:52 PM, Rich reholme...@googlemail.com
  wrote:
I am validating a form that is submitted by an image input (input
type=image), there are 3 of these inputs which either publish, save or
delete the form details. If I turn javascript off and submit the form
I can pick up the value of the input button used. i.e. request.form
(publish.x) = ?, if I turn javascript on and use the jQuery validate
plugin it does everything excpet pass the value of the button pressed
so I can't detect which button has been pressed. Any help appreciated.

[code]
$(function() {
       $(#vml_library).validate({
               ignore: input[type=hidden],
               rules: {
                       mName: {
                               required: true
                       },
                       mSummary: {
                               maxlength: 200
                       },
                       mDescription: {
                               required: true
                       },
                       mFile: {
                               required: true,
                               accept:
+$(input[name=typeList]).val().replace(/\'/g,
'').replace(/\./g, '').replace(/,/g, '|') +
                       },
                       tFile: {
                               required: function(element) {
                                       return
  $(input[name=vType]).val()
 1;
                               },
                               accept: true
                       }
               },
               messages: {
                       mName: {
                               required: Required
                       },
                       mFile: {
                               required: Required,
                               accept: Invalid File, must be  +
$(input[name=typeList]).val()
                       },
                       mSummary: {
                               maxlength: You may not use anymore than
  200
characters
                       },
                       mDescription: {
                               required: Required
                       },
                       tFile: {
                               required: Required,
                               accept: Invalid File, must be '.jpg',
'.jpeg', '.gif' or '.png'
                       }
               },
               success: function(label) {
                       label.addClass(valid).text(OK!);
               },
               highlight: function(element, errorClass) {
                       $(element).addClass(errorInput);
               },
               unhighlight: function(element, errorClass) {
                       $(element).removeClass(errorInput);
               },
               submitHandler: function(form) {
                       ShowProgress();
                       form.submit();
               }
       });

});
[/code]


[jQuery] jQuery Validate and Dialog Confirm. submit() not working.

2009-11-30 Thread impact
I have a form that is being valdiated with jQuery validate plugin. On
clicking submit, and after form has been succesfully validated, I want
a dialog confirmation to appear, then on clicking OK, the form
submits.

See my code below.  The Dialog opens fine.  Dialog works fine, but the
form does not submit when OK is clicked.

My guess is the .submit() call is sending the process back into the
validate() process, causing some kind of loop, but I can't think of
any other way to do this.

Any suggestions on what I am doing wrong here will be greatly
appreciated.

===

// Initialize Dialog Box
$('#dialog').dialog({
autoOpen: false,
width: 400,
modal: true,
title: 'Confirm Purchase of Credit.',
close: function() {$('#dialog p').empty();},
buttons: {
Ok: function() {
$(#purchase_credit).submit
();
$('#dialog p').empty();
},
Cancel: function() {
$(this).dialog(close);
$('#dialog p').empty();
}
}
});



// dialog being opened from validate() using the submithandler.
submitHandler: function(form) {
$('#dialog p').append('Click \'OK\' to
confirm Purchase of $' + $(#cc_amount).val() + ' Credit.brbrThis
amount will be charged to the Credit Card
Entered.');
$('#dialog').dialog('open');
}



note this message quoted from j...@oz


[jQuery] Validate plugin: insertAfter problem/question

2009-11-30 Thread Gian
I am using the jQuery Validation plugin in conjuction with the
jqTransform plugin to style the form.

I need to insert the error message after the rowElem div. I can do
that, but the problem is that for each input field I get all the error
messages form the other fields.
Example: if I got 3 required fields, when I hit submit I got 3 times
this field is required after each rowElem which include the submit
button.

Thi is the HTML output before the submission (with the output from the
jqTransform plugin):

div class=rowElem
div class=jqTransformInputWrapper
div class=jqTransformInputInner
divinput type=text name=dname class=default-value
required jqtranformdone jqTransformInput id=dname style=color: rgb
(204, 204, 204);/
/div
/div
/div
/div

This is the JS:

script type=text/javascript
// VALIDATION + AJAX FORM
$(document).ready(function(){
$('#contactform').validate({

errorPlacement: function(error, element) {
error.insertAfter('.rowElem');
},

 submitHandler: function(form) {

   $(form).ajaxSubmit({
success: function() {
$('#contactform').hide();
$('.contact-col h4').hide();
$('#contact-col-form').append(p
class='thanks'Thanks! Your request has been sent./p)
}
   });
 }

});
});
/script

Any help to solve this multipling effect is appreciated.
Thanks.


[jQuery] Validate: a question about the Remote option

2009-11-30 Thread Andre Polykanine
Hello everyone,

I'm still dealing with that signup form.
Now I'd like to check with an Ajax call if a login is already taken.
That's what I'm doing:

$(#signup).validate( {
rules: {
ulogin: {
required: true,
// It's a custom method checking a regexp, it's working
login: true,
rangelength: [3,20],
remote: check.php?w=1
},
   ...

Here's the check.php file:

// Including the connection file, blah blah
...
$valid=true;
// Since I'm planning to use this file as a multipurpose script,
//preventing it from stop working
if (!isset($_REQUEST['w'])) $_REQUEST['w']=1;
if ($_REQUEST['w']==1) {
// If the login is taken, it will return something 0
$number=mysql_num_rows(mysql_query(SELECT `Id` FROM `Users` WHERE 
`Login`='.$_REQUEST['ulogin'].', $link));
if ($number0) $valid=false; else $valid=true;
}
After I validate, it stops working: it says incorrect for all fields
after the second submit. After the first submit it says nothing, even
that the login is already taken.
What's wrong?
Thanks!

-- 
With best regards from Ukraine,
Andre
Skype: Francophile; WlmMSN: arthaelon @ yandex.ru; Jabber: arthaelon @ 
jabber.org
Yahoo! messenger: andre.polykanine; ICQ: 191749952
Twitter: m_elensule



Re: [jQuery] Validate: a question about the Remote option

2009-11-30 Thread Juan Ignacio Borda
hey..!!! you have to actually ECHO the result of your validation the 
remote method expects the response to be true or false.


good luck!
 Original Message 

Hello everyone,

I'm still dealing with that signup form.
Now I'd like to check with an Ajax call if a login is already taken.
That's what I'm doing:

$(#signup).validate( {
rules: {
ulogin: {
required: true,
// It's a custom method checking a regexp, it's working
login: true,
rangelength: [3,20],
remote: check.php?w=1
},
   ...

Here's the check.php file:

// Including the connection file, blah blah
...
$valid=true;
// Since I'm planning to use this file as a multipurpose script,
//preventing it from stop working
if (!isset($_REQUEST['w'])) $_REQUEST['w']=1;
if ($_REQUEST['w']==1) {
// If the login is taken, it will return something 0
$number=mysql_num_rows(mysql_query(SELECT `Id` FROM `Users` WHERE 
`Login`='.$_REQUEST['ulogin'].', $link));
if ($number0) $valid=false; else $valid=true;
}
After I validate, it stops working: it says incorrect for all fields
after the second submit. After the first submit it says nothing, even
that the login is already taken.
What's wrong?
Thanks!

  



attachment: juanignacioborda.vcf

[jQuery] jQuery Validate using input type=image

2009-11-27 Thread Rich
I am validating a form that is submitted by an image input (input
type=image), there are 3 of these inputs which either publish, save or
delete the form details. If I turn javascript off and submit the form
I can pick up the value of the input button used. i.e. request.form
(publish.x) = ?, if I turn javascript on and use the jQuery validate
plugin it does everything excpet pass the value of the button pressed
so I can't detect which button has been pressed. Any help appreciated.

[code]
$(function() {
$(#vml_library).validate({
ignore: input[type=hidden],
rules: {
mName: {
required: true
},
mSummary: {
maxlength: 200
},
mDescription: {
required: true
},
mFile: {
required: true,
accept: 
+$(input[name=typeList]).val().replace(/\'/g,
'').replace(/\./g, '').replace(/,/g, '|') +
},
tFile: {
required: function(element) {
return $(input[name=vType]).val()  1;
},
accept: true
}
},
messages: {
mName: {
required: Required
},
mFile: {
required: Required,
accept: Invalid File, must be  + 
$(input[name=typeList]).val()
},
mSummary: {
maxlength: You may not use anymore than 200 
characters
},
mDescription: {
required: Required
},
tFile: {
required: Required,
accept: Invalid File, must be '.jpg', '.jpeg', 
'.gif' or '.png'
}
},
success: function(label) {
label.addClass(valid).text(OK!);
},
highlight: function(element, errorClass) {
$(element).addClass(errorInput);
},
unhighlight: function(element, errorClass) {
$(element).removeClass(errorInput);
},
submitHandler: function(form) {
ShowProgress();
form.submit();
}
});

});
[/code]


Re: [jQuery] jQuery Validate using input type=image

2009-11-27 Thread Jörn Zaefferer
The plugin handles that case, though only for type=submit. You could try
using a button instead:

button type=submitimg ... //button

Jörn

On Fri, Nov 27, 2009 at 12:52 PM, Rich reholme...@googlemail.com wrote:

 I am validating a form that is submitted by an image input (input
 type=image), there are 3 of these inputs which either publish, save or
 delete the form details. If I turn javascript off and submit the form
 I can pick up the value of the input button used. i.e. request.form
 (publish.x) = ?, if I turn javascript on and use the jQuery validate
 plugin it does everything excpet pass the value of the button pressed
 so I can't detect which button has been pressed. Any help appreciated.

 [code]
 $(function() {
$(#vml_library).validate({
ignore: input[type=hidden],
rules: {
mName: {
required: true
},
mSummary: {
maxlength: 200
},
mDescription: {
required: true
},
mFile: {
required: true,
accept:
 +$(input[name=typeList]).val().replace(/\'/g,
 '').replace(/\./g, '').replace(/,/g, '|') +
},
tFile: {
required: function(element) {
return $(input[name=vType]).val()
  1;
},
accept: true
}
},
messages: {
mName: {
required: Required
},
mFile: {
required: Required,
accept: Invalid File, must be  +
 $(input[name=typeList]).val()
},
mSummary: {
maxlength: You may not use anymore than 200
 characters
},
mDescription: {
required: Required
},
tFile: {
required: Required,
accept: Invalid File, must be '.jpg',
 '.jpeg', '.gif' or '.png'
}
},
success: function(label) {
label.addClass(valid).text(OK!);
},
highlight: function(element, errorClass) {
$(element).addClass(errorInput);
},
unhighlight: function(element, errorClass) {
$(element).removeClass(errorInput);
},
submitHandler: function(form) {
ShowProgress();
form.submit();
}
});

 });
 [/code]



Re: [jQuery] [validate] Specifying custom highlight/unhighlight methods problem

2009-11-26 Thread Jörn Zaefferer
The validation plugin hides labels based on the error class. By adding that
class to your regular label, it'll get hidden, too. Try using a different
class for the regular label (with the same styles).

Jörn

On Wed, Nov 25, 2009 at 4:35 PM, Imre Farkas farkasimr...@gmail.com wrote:

 I'm trying to specify a couple of custom methods for highlighting/
 unhighlighting valid/invalid fields on my form, but I'm getting some
 strange behaviour, which I'm not sure is due to me misunderstanding
 how these methods are supposed to be implemented, or if it's just
 buggy.

 $().ready(function() {
// validate signup form on keyup and submit
$(#contactForm).validate({
showErrors: function(errorMap, errorList) {
$(#result).html('span class=errors/spanspan
 class=msgPlease check/fill the marked fields/span !');
this.defaultShowErrors();
},
highlight: function(element, errorClass) {
 $(element.form).find(label[for= + element.id +
 ]).addClass
 (errorClass);
  },
unhighlight: function(element, errorClass) {
 $(element.form).find(label[for= + element.id +
 ]).removeClass
 (errorClass);
  },
rules: {
name: required,
email: {
required: true,
email: true
}
}
});
 });
 My problem is when some of inputs in invalid, then the label will take
 the error class, will be turn on red, when I correct the content of
 input my label disapear,  I have also the valid class, in my css
 file, what colud be the problem

 I hope You understand what I mean;



[jQuery] Validate / Remote

2009-11-26 Thread RCLumbriga
Hi..  Sory the really bad english

I have one problem with remote in Jquery.validate

I do this

 cusuario:{
required: true, minlength: 5,
remote: verifica_user.php
},

Now  i whant know how the script verifica_user.php will recive the
information..


I still trying make one script when any user go create on account,,
first will verify if this account exist. If exist will appear on
message.. This accound still in use. Please choice another..

But i don't know how get the user still typing and pass from php
script, where will do this comparation..

Thanks


Re: [jQuery] Validate / Remote

2009-11-26 Thread Jörn Zaefferer
That script will get a single GET paremter with the name of the field as the
key and the value of the field as the value, here you'd get
verifica_user.php?cusuario=username

Jörn

On Thu, Nov 26, 2009 at 1:30 PM, RCLumbriga ronanl...@gmail.com wrote:

 Hi..  Sory the really bad english

 I have one problem with remote in Jquery.validate

 I do this

  cusuario:{
required: true, minlength: 5,
remote: verifica_user.php
},

 Now  i whant know how the script verifica_user.php will recive the
 information..

 
 I still trying make one script when any user go create on account,,
 first will verify if this account exist. If exist will appear on
 message.. This accound still in use. Please choice another..

 But i don't know how get the user still typing and pass from php
 script, where will do this comparation..

 Thanks



[jQuery] [validate] Issues validating two different forms on same page using validation plugin

2009-11-25 Thread MarkW
Hi.

Would have posted this on the actual plugin page but comments are
closed I was sent here instead. Here's the plugin page:
http://bassistance.de/jquery-plugins/jquery-plugin-validation/

I have two different forms on the same page with different id
attributes. Both have separate validate methods and their own rules
for validation. I have setup an invalidHandler method (coded in both
validate methos) that wraps the original form labels in a span tag to
make them appear in red when the input is invalid.

When one form is validated and the labels of invalid fields are
wrapped in the span and made to appear red, the second form also seems
to be validated as all of it's labels appear in red and have the span
added to them. It seems to me that when the first form is submitted,
the second is as well. of course none of that is filled out so all
fields have errors.

I can't see the difference between my two forms and the two forms on
the demo page of the plugin.

Can anyone help?

Thanks.


[jQuery] Validate: more info on options

2009-11-25 Thread Andre Polykanine
Hello everyone,

I decided to use the Validate plugin as suggested by many of you here.
But either I can't read, or I can't search, but I didn't manage to
find a description or a user guide for the options used by Rules()
method, for example. I have seen required, email, equalTo, and
minlength.
Where could I read about that?
Thanks!

-- 
With best regards from Ukraine,
Andre
Skype: Francophile; WlmMSN: arthaelon @ yandex.ru; Jabber: arthaelon @ 
jabber.org
Yahoo! messenger: andre.polykanine; ICQ: 191749952
Twitter: m_elensule



Re: [jQuery] Validate: more info on options

2009-11-25 Thread Jörn Zaefferer
The documentation for the plugin is here:
http://docs.jquery.com/Plugins/Validation
That includes documentation for the rules() method as well as descriptions
for all built-in validation methods (
http://docs.jquery.com/Plugins/Validation#List_of_built-in_Validation_methods
).

Jörn

On Wed, Nov 25, 2009 at 3:26 PM, Andre Polykanine an...@arthaelon.netwrote:

 Hello everyone,

 I decided to use the Validate plugin as suggested by many of you here.
 But either I can't read, or I can't search, but I didn't manage to
 find a description or a user guide for the options used by Rules()
 method, for example. I have seen required, email, equalTo, and
 minlength.
 Where could I read about that?
 Thanks!

 --
 With best regards from Ukraine,
 Andre
 Skype: Francophile; WlmMSN: arthaelon @ yandex.ru; Jabber: arthaelon @
 jabber.org
 Yahoo! messenger: andre.polykanine; ICQ: 191749952
 Twitter: m_elensule




Re[2]: [jQuery] Validate: more info on options

2009-11-25 Thread Andre Polykanine
Hello Jörn and all,

Sorry, but I still can't find the table of options accepted by the
Rules() method. In the Rules() sections it says that they are the same
as in Rules parameter of Validate() method, and in Validate() topic it
says See Rules() for detailed description :-).
-- 
With best regards from Ukraine,
Andre
Skype: Francophile; WlmMSN: arthaelon @ yandex.ru; Jabber: arthaelon @ 
jabber.org
Yahoo! messenger: andre.polykanine; ICQ: 191749952
Twitter: m_elensule

- Original message -
From: Jorn Zaefferer joern.zaeffe...@googlemail.com
To: jquery-en jquery-en@googlegroups.com
Date: Wednesday, November 25, 2009, 4:41:28 PM
Subject: [jQuery] Validate: more info on options

The documentation for the plugin is here:
http://docs.jquery.com/Plugins/Validation
That includes documentation for the rules() method as well as descriptions
for all built-in validation methods (
http://docs.jquery.com/Plugins/Validation#List_of_built-in_Validation_methods
).

Jorn

On Wed, Nov 25, 2009 at 3:26 PM, Andre Polykanine an...@arthaelon.netwrote:

 Hello everyone,

 I decided to use the Validate plugin as suggested by many of you here.
 But either I can't read, or I can't search, but I didn't manage to
 find a description or a user guide for the options used by Rules()
 method, for example. I have seen required, email, equalTo, and
 minlength.
 Where could I read about that?
 Thanks!

 --
 With best regards from Ukraine,
 Andre
 Skype: Francophile; WlmMSN: arthaelon @ yandex.ru; Jabber: arthaelon @
 jabber.org
 Yahoo! messenger: andre.polykanine; ICQ: 191749952
 Twitter: m_elensule





[jQuery] [validate] Specifying custom highlight/unhighlight methods problem

2009-11-25 Thread Imre Farkas
I'm trying to specify a couple of custom methods for highlighting/
unhighlighting valid/invalid fields on my form, but I'm getting some
strange behaviour, which I'm not sure is due to me misunderstanding
how these methods are supposed to be implemented, or if it's just
buggy.

$().ready(function() {
// validate signup form on keyup and submit
$(#contactForm).validate({
showErrors: function(errorMap, errorList) {
$(#result).html('span class=errors/spanspan
class=msgPlease check/fill the marked fields/span !');
this.defaultShowErrors();
},
highlight: function(element, errorClass) {
 $(element.form).find(label[for= + element.id + 
]).addClass
(errorClass);
  },
unhighlight: function(element, errorClass) {
 $(element.form).find(label[for= + element.id + 
]).removeClass
(errorClass);
  },
rules: {
name: required,
email: {
required: true,
email: true
}
}
});
});
My problem is when some of inputs in invalid, then the label will take
the error class, will be turn on red, when I correct the content of
input my label disapear,  I have also the valid class, in my css
file, what colud be the problem

I hope You understand what I mean;


[jQuery] Validate: Display errors after Ajax form submit

2009-11-25 Thread Ted
I have the validator setup nicely with client side rules and some
remote validations.  That part is working well.

When the form is submitted (via ajax) there may be some more
complicated server side validations that generate errors. (Such as
checking a credit card with the cc service, db concurrency issues,
etc)

When I gather these server side errors, I send them in a JSON response
with HTTP code 200.  The best method I could find in the documentation
was showErrors.  I have this working also, where the 1 or more
server side errors are shown next to each field in error.

The problem is that while this shows them, it doesn't register these
as errors, like the client side errors.  For these server side errors,
once the user changes some other field to trigger a client side error,
the server errors displayed with showErrors vanish.  Also, for client
errors, the submit button does not trigger submit.  With showErrors of
server errors, they can submit again right away.

Looking for a method like showErrors that will treat these errors just
like the other Rules based ones, not clearing the error until the user
has changed that data in some way.





[jQuery] [validate] - errorPlacement help

2009-11-24 Thread Loony2nz
Hello,

I'm having difficulty traversing the DOM with the validate plugin.
I'm sure Jorn can figure this out quikcly :)

I'm trying to target the error message to be placed in the span
class=errorMsg tag.  This tag can be any # of elements past the
input or checkbox or whatever is being validated.

Here's a sample:
div id=uploadImage class=field
 input type=file name=file id=filespan class=errorMsg/
span
brbr
 input type=checkbox id=photoConfirm name=photoConfirm
value=approve / I confirm that I have permission to include this
photograph
br
span class=errorMsg/span
div class=clearBreak/div
/div

The span class=errorMsg is right after the input tag and 2
elements past the checkbox.

How can I traverse the DOM to get to the span tag x # of tags past the
validated element?

Thanks!


[jQuery] (validate) $.format() abnormalities

2009-11-23 Thread mahdoum
Hello,

I'm using the following string as an error message when a username is
already taken
remote: $.format({0} already exists)
I am also using keyup validation.

The problem is if a user types test in the username field (username
is already taken) then the message test already exists comes up.

But when on the same page, the user deletes test and types
test2 (another username that is taken) then the message test
already exists comes up. This message should be test2 already
exists.

Anyone know how to fix this?

Thanks


[jQuery] (validate)

2009-11-23 Thread Gregory Kaidanov
I am trying to override only the showLabel function in the
jquery.validate.js .
I've found inheritence plugin for it.
Nevertheless , I wasn't able to implement the example givven with it.
Is there any way that I can reuse the  jquery.validate.js  without
changing the original , but by overriding the function somehow , so
that the label will be handled in some other manner in my own file of
js ?


[jQuery] Re: (Jquery Validate) Keep getting an error in IE8

2009-11-23 Thread djseng
I'm getting this same error. Does anyone have a patch for it?

On Nov 7, 9:31 pm, chobo2 howser_...@hotmail.com wrote:
 Hi

 I don't know what is going but my jqueryvalidateplugin(1.5.5) is not
 working and I am not sure for how long since I do most of my testing
 on firefox.

 The problem is this I go to one of my forms that jqueryvalidateon it
 and hit my create button my validation kicks in as it should and
 does this right in all browsers including IE8. Now where it does not
 work is when I do this.

 I choose the first dropdown list and choose something. Then hit
 create now all validation errors should show up expect the one for
 the first dropdown box.

 It does this in all browsers except in IE 8. I get this

  Webpage error details

  User Agent: Mozilla/4.0 (compatible;
  MSIE 8.0; Windows NT 6.1; Win64; x64;
  Trident/4.0; .NET CLR 2.0.50727;
  SLCC2; .NET CLR 3.5.30729; .NET CLR
  3.0.30729; Media Center PC 6.0; Tablet PC 2.0) Timestamp: Sun, 8 Nov 2009
  03:26:08 UTC

  Message: Object required Line: 890
  Char: 5 Code: 0 URI:
 http://localhost:3668/Scripts/Plugins-Development/jquery.validate.js

 This is what is on line 890

     return options.length  0  ( element.type == select-multiple
 || ($.browser.msie  !(options[0].attributes['value'].specified) ?
 options[0].text : options[0].value).length  0);

 This like the whole method block.

         methods: {

                 //http://docs.jquery.com/Plugins/Validation/Methods/required
                 required: function(value, element, param) {
                         // check if dependency is met
                         if ( !this.depend(param, element) )
                                 return dependency-mismatch;
                         switch( element.nodeName.toLowerCase() ) {
                         case 'select':
                                 var options = $(option:selected, element);
                                 return options.length  0  ( element.type 
 == select-multiple
 || ($.browser.msie  !(options[0].attributes['value'].specified) ?
 options[0].text : options[0].value).length  0);
                         case 'input':
                                 if ( this.checkable(element) )
                                         return this.getLength(value, element) 
  0;
                         default:
                                 return $.trim(value).length  0;
                         }
                 },

 Not sure what is going on.


[jQuery] validate with changing default submit

2009-11-22 Thread mike

I am a novice at jquery/javascript.

I am trying to use validate plugin and then make a ajax request with
post() and I am thoroughly confused by the submitHandler option

Here's what I have:

The html

form id=mail_form name=mail_form method=post action=xxx.php 
// many form elements here using validate plugin
input class=submit type=submit id=mail_button value=Submit  /

/form
// where xxx.php is NOT what I want to have executed because I don't
want a page refresh.

The jquery stuff
-
$(document).ready(function(){
   $('#mail_form').validate();

   $('#mail_form').submit(function() {
  var formData = $('#mail_form').serialize();
  $.post('mailer.php',formData,processResponse);
  function processResponse(data,status) {
if(status='success') {
$('#zone1').html(data);
} else {
$('#zone1').html('p class=message_textAn error has occured./
p');
}
  }
});

I want to execute mailer.php.  I understand I should use the
submitHandler: but I have no idea how to do it and retain the usage of
serialize and post().

The documentation for this case says:

$(.selector).validate({
   submitHandler: function(form) {
$(form).ajaxSubmit();
   }
})

but looking at the docs for ajaxSubmit seems to get orders of
magnitude more complicated.  Suggestions?  Thanks.

Mike


[jQuery] (validate)

2009-11-21 Thread Juan Borda
hi there i'm working with the remote method of validator plug-in to
have in response validity and a message... and i have it working!
the plugin show the remote msg ok but on lost focus i get:

Warning: No message defined for DE1695

the remote script always return {valid:tue,msg:somemsg}

test input (not valid ) 20-24006411-2
any other number with the same format will be ok.

test page: www.accionpyme.mecon.gov.ar/dna2/TEST/CUIT.php

the method:

function remotemsg(value, element, param) {
if ( this.optional(element) )
return dependency-mismatch;

var previous = this.previousValue(element);

if (!this.settings.messages[element.name] )
this.settings.messages[element.name] = {};
//this.settings.messages[element.name].remote = typeof
previous.message == function ? previous.message(value) :
previous.message;

param = typeof param == string  {url:param} || 
param;

if ( previous.old !== value ) {
previous.old = value;
var validator = this;
this.startRequest(element);
var data = {};
data[element.name] = value;
$.ajax($.extend(true, {
url: param,
mode: abort,
port: validate + element.name,
dataType: json,
data: data,
success: function(response) {
console.log(response.msg);
var valid = response.valid === 
true;
if ( valid ) {
var submitted = 
validator.formSubmitted;

validator.prepareElement(element);
validator.formSubmitted 
= submitted;

validator.successList.push(element);
validator.showErrors();
} else {
var errors = {};
errors[element.name] = 
response.msg;

validator.showErrors(errors);
}
previous.valid = valid;
validator.stopRequest(element, 
valid);
}
}, param));
return pending;
} else if( this.pending[element.name] ) {
return pending;
}
return previous.valid;
}
jQuery.validator.addMethod(CUITR, remotemsg,false);


Re: [jQuery] (validate)

2009-11-21 Thread Tsz Ming WONG
On Sun, Nov 22, 2009 at 11:21 AM, Enoch enochelli...@gmail.com wrote:
script type=text/javascript
$().ready(function() {
   // validate signup form on keyup and submit
   $(#regform).validate({
   rules: {
   fname: {
   required: true,
   minlength: 2
   },
   email: {
   required: true,
   email: true
   },
   messages: {
   fname: Please enter your firstname,
   email: Please enter a valid email address,
   }
 }});
});


Because you have syntax error in your code.

Also, extra comma after  `email: Please enter a valid email address` is
not needed.




-- 
Best Regards,
tszming


[jQuery] (validate) error in IE7

2009-11-17 Thread dmikester1
Here is the screenshot of the bug or error in IE7.  Can anyone help me
figure this one out?
http://www.michaelandregina.com/jqueryErrorInIE7.png
Thanks
Mike


Re: [jQuery] (validate) error in IE7

2009-11-17 Thread Jörn Zaefferer
Could you provide some code? A testpage? jsbin.com works great for that.

Jörn

On Tue, Nov 17, 2009 at 4:39 PM, dmikester1 dmikest...@gmail.com wrote:

 Here is the screenshot of the bug or error in IE7.  Can anyone help me
 figure this one out?
 http://www.michaelandregina.com/jqueryErrorInIE7.png
 Thanks
 Mike



[jQuery] (validate) custom message for maxlength

2009-11-17 Thread Kasvis
Hi,

I am trying to customize the message for maxlength rule.

I want to show the current text length entered in the message
something like this.

'Comments' must not exceed 660 characters. You entered 754 characters

Is there a way to create the message to include the current length.

Thanks



Re: [jQuery] (validate) custom message for maxlength

2009-11-17 Thread Jörn Zaefferer
Sure:

messages: {
  comments: {
maxlength: function(max) {
  return 'Comments' must not exceed  + max +  characters. You entered
 + $(input[name=maxlength]).val().length +  characters;
}
  }
}

Jörn

On Tue, Nov 17, 2009 at 8:16 PM, Kasvis kasvis...@gmail.com wrote:

 Hi,

 I am trying to customize the message for maxlength rule.

 I want to show the current text length entered in the message
 something like this.

 'Comments' must not exceed 660 characters. You entered 754 characters

 Is there a way to create the message to include the current length.

 Thanks




[jQuery] custon error Jquery Validate

2009-11-16 Thread Theodoro
When I use the jquery validate it creates a label with the error
message field and add the error class in my imput, but I want him to
add that only the class of error in the input without creating the
label is possible?


[jQuery] validate

2009-11-16 Thread marinab
I'm using the validate.js plugin but need to validate the form onblur
instead of onsubmit.
How do I alter the code to validate onblur?

Thanks,

Marina


[jQuery] Re: Jquery Validate Problem on IE (Need Help)

2009-11-15 Thread debian
I have the same problem without any $addMethod's. I saw some threads
about comma problems but can't make it work too :( . Did you find any
solution?

On 14 Kasım, 10:24, serhat serhatsarika...@gmail.com wrote:
 I really need a solution soon can any one check my code?

 On 14 Kasım, 00:17, serhat serhatsarika...@gmail.com wrote:



  I also tried without $.validator.addMethod but still have the same
  problem... Any idea or fix for this validation script? Thx for any
  advise :)

  On 13 Kasým, 18:25, serhat serhatsarika...@gmail.com wrote:

   I have a form validation with Jquery+Jquery Validation Plugin. I tried
   all variations on my page but cant make it work on IE 6.0 , 7.0 or 8.0
   but both Firefox and Chrome works great. The code is;

   $(document).ready(function() {
          $.validator.addMethod(kullanici, function (value, element) {
                  return /^[a-zA-Z0-9]+$/.test(value);
          },Format);

          $.validator.addMethod(dogum, function (value, element) {
                  return /^(((0[1-9]|[12]\d|3[01])\/(0[13578]|1[02])\/
   ((19|[2-9]\d)\d
   {2}))|((0[1-9]|[12]\d|30)\/(0[13456789]|1[012])\/((19|[2-9]\d)\d{2}))|
   ((0[1-9]|1\d|2[0-8])\/02\/((19|[2-9]\d)\d{2}))|(29\/02\/((1[6-9]|
   [2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])
   00$/.test(value);
          },Tarih formatý Gün/Ay/Yýl olmalýdýr);

          $.validator.addMethod(cep, function (value, element) {
                  return /[0-9]{7}/.test(value);
          },Cep telefonu formatý yanlýþ);

          var validator = $(#Uyeolform).validate({
                  rules: {
                          KULLANICI_ADI: {
                                  required: true,
                                  minlength: 6,
                                  maxlength: 20,
                                  kullanici: true
                          },
                          SIFRE: {
                                  required: true,
                                  minlength: 6
                          },
                          V_SIFRE: {
                                  required: true,
                                  equalTo: #SIFRE
                          },
                          GIZLI_SORU: required,
                          GIZLI_SORUM: required,
                          GIZLI_SORU_CEVAP: required,
                          ADI: required,
                          SOYADI: required,
                          EMAIL: {
                                  required: true,
                                  email: true
                          },
                          V_EMAIL: {
                                  required: true,
                                  equalTo: #EMAIL
                          },
                          CEP_TEL1: required,
                          CEP_TEL2: {
                                  required: true,
                                  cep: true
                          },
                          DOGUM_TARIHI: {
                                  dogum: true,
                                  required: true
                          },
                          SEHIR: required,
                          SOZLESME: required
                  },
                  messages: {
                          KULLANICI_ADI: {
                                  required: Kullanýcý adýnýzý giriniz,
                                  minlength: jQuery.format(En az {0}
   karakter girebilirsiniz),
                                  maxlength: jQuery.format(En fazla {0}
   karakter girebilirsiniz),
                                  kullanici: Boþluk ve Türkçe karakter
   kullanýlmadan en az 6
   karakter,
                          },
                          SIFRE: {
                                  required: Þifrenizi giriniz,
                                  minlength: jQuery.format(En az {0}
   karakter girebilirsiniz)
                          },
                          V_SIFRE: {
                                  required: Þifrenizi tekrar giriniz,
                                  equalTo: Þifreler uyumsuz
                          },
                          GIZLI_SORU: Gizli sorunuzu seçiniz,
                          GIZLI_SORUM: Kendi gizli sorunuzu yazýnýz veya
   varolanlardan
   birini seçiniz,
                          GIZLI_SORU_CEVAP: Gizli sorunuzun cevabýný
   giriniz,
                          ADI: Adýnýzý giriniz,
                          SOYADI: Soyadýnýzý giriniz,
                          EMAIL: {
                                  required: Email adresinizi giriniz,
                                  email: Lütfen geçerli bir email adresi
   giriniz
                          },
                          V_EMAIL: {
                                  required: Email adresinizi tekrar
   giriniz,
                                  equalTo: Email adresleri uyumsuz
                          },
                          CEP_TEL1: Lütfen operatör 

[jQuery] Re: Jquery Validate Problem on IE (Need Help)+1

2009-11-15 Thread serhat
Sorry my friend, still wating for solution. Tried a lot but still have
the same problem :( We will get a solution just wait for replies.

On 15 Kasım, 13:13, debian debian...@gmail.com wrote:
 I have the same problem without any $addMethod's. I saw some threads
 about comma problems but can't make it work too :( . Did you find any
 solution?

 On 14 Kasım, 10:24, serhat serhatsarika...@gmail.com wrote:



  I really need a solution soon can any one check my code?

  On 14 Kasım, 00:17, serhat serhatsarika...@gmail.com wrote:

   I also tried without $.validator.addMethod but still have the same
   problem... Any idea or fix for this validation script? Thx for any
   advise :)

   On 13 Kasým, 18:25, serhat serhatsarika...@gmail.com wrote:

I have a form validation with Jquery+Jquery Validation Plugin. I tried
all variations on my page but cant make it work on IE 6.0 , 7.0 or 8.0
but both Firefox and Chrome works great. The code is;

$(document).ready(function() {
       $.validator.addMethod(kullanici, function (value, element) {
               return /^[a-zA-Z0-9]+$/.test(value);
       },Format);

       $.validator.addMethod(dogum, function (value, element) {
               return /^(((0[1-9]|[12]\d|3[01])\/(0[13578]|1[02])\/
((19|[2-9]\d)\d
{2}))|((0[1-9]|[12]\d|30)\/(0[13456789]|1[012])\/((19|[2-9]\d)\d{2}))|
((0[1-9]|1\d|2[0-8])\/02\/((19|[2-9]\d)\d{2}))|(29\/02\/((1[6-9]|
[2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])
00$/.test(value);
       },Tarih formatý Gün/Ay/Yýl olmalýdýr);

       $.validator.addMethod(cep, function (value, element) {
               return /[0-9]{7}/.test(value);
       },Cep telefonu formatý yanlýþ);

       var validator = $(#Uyeolform).validate({
               rules: {
                       KULLANICI_ADI: {
                               required: true,
                               minlength: 6,
                               maxlength: 20,
                               kullanici: true
                       },
                       SIFRE: {
                               required: true,
                               minlength: 6
                       },
                       V_SIFRE: {
                               required: true,
                               equalTo: #SIFRE
                       },
                       GIZLI_SORU: required,
                       GIZLI_SORUM: required,
                       GIZLI_SORU_CEVAP: required,
                       ADI: required,
                       SOYADI: required,
                       EMAIL: {
                               required: true,
                               email: true
                       },
                       V_EMAIL: {
                               required: true,
                               equalTo: #EMAIL
                       },
                       CEP_TEL1: required,
                       CEP_TEL2: {
                               required: true,
                               cep: true
                       },
                       DOGUM_TARIHI: {
                               dogum: true,
                               required: true
                       },
                       SEHIR: required,
                       SOZLESME: required
               },
               messages: {
                       KULLANICI_ADI: {
                               required: Kullanýcý adýnýzý giriniz,
                               minlength: jQuery.format(En az {0}
karakter girebilirsiniz),
                               maxlength: jQuery.format(En fazla {0}
karakter girebilirsiniz),
                               kullanici: Boþluk ve Türkçe karakter
kullanýlmadan en az 6
karakter,
                       },
                       SIFRE: {
                               required: Þifrenizi giriniz,
                               minlength: jQuery.format(En az {0}
karakter girebilirsiniz)
                       },
                       V_SIFRE: {
                               required: Þifrenizi tekrar giriniz,
                               equalTo: Þifreler uyumsuz
                       },
                       GIZLI_SORU: Gizli sorunuzu seçiniz,
                       GIZLI_SORUM: Kendi gizli sorunuzu yazýnýz veya
varolanlardan
birini seçiniz,
                       GIZLI_SORU_CEVAP: Gizli sorunuzun cevabýný
giriniz,
                       ADI: Adýnýzý giriniz,
                       SOYADI: Soyadýnýzý giriniz,
                       EMAIL: {
                               required: Email adresinizi giriniz,
                               email: Lütfen geçerli bir email adresi
giriniz
   

[jQuery] Re: Jquery Validate Problem on IE (Solved)

2009-11-15 Thread serhat
-
kullanici: Boşluk ve Türkçe karakter kullanılmadan en az 6
karakter,
} * , *
SIFRE: {
-

that comma makes the script crash. Thx Hasan Tayyar BESIK from
http://groups.google.com.tr/group/jquery-turkish/browse_thread/thread/1a4968641fbe5e7b
.

On 15 Kasım, 17:51, serhat serhatsarika...@gmail.com wrote:
 Sorry my friend, still wating for solution. Tried a lot but still have
 the same problem :( We will get a solution just wait for replies.

 On 15 Kasım, 13:13, debian debian...@gmail.com wrote:



  I have the same problem without any $addMethod's. I saw some threads
  about comma problems but can't make it work too :( . Did you find any
  solution?

  On 14 Kasım, 10:24, serhat serhatsarika...@gmail.com wrote:

   I really need a solution soon can any one check my code?

   On 14 Kasım, 00:17, serhat serhatsarika...@gmail.com wrote:

I also tried without $.validator.addMethod but still have the same
problem... Any idea or fix for this validation script? Thx for any
advise :)

On 13 Kasým, 18:25, serhat serhatsarika...@gmail.com wrote:

 I have a form validation with Jquery+Jquery Validation Plugin. I tried
 all variations on my page but cant make it work on IE 6.0 , 7.0 or 8.0
 but both Firefox and Chrome works great. The code is;

 $(document).ready(function() {
        $.validator.addMethod(kullanici, function (value, element) {
                return /^[a-zA-Z0-9]+$/.test(value);
        },Format);

        $.validator.addMethod(dogum, function (value, element) {
                return /^(((0[1-9]|[12]\d|3[01])\/(0[13578]|1[02])\/
 ((19|[2-9]\d)\d
 {2}))|((0[1-9]|[12]\d|30)\/(0[13456789]|1[012])\/((19|[2-9]\d)\d{2}))|
 ((0[1-9]|1\d|2[0-8])\/02\/((19|[2-9]\d)\d{2}))|(29\/02\/((1[6-9]|
 [2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])
 00$/.test(value);
        },Tarih formatý Gün/Ay/Yýl olmalýdýr);

        $.validator.addMethod(cep, function (value, element) {
                return /[0-9]{7}/.test(value);
        },Cep telefonu formatý yanlýþ);

        var validator = $(#Uyeolform).validate({
                rules: {
                        KULLANICI_ADI: {
                                required: true,
                                minlength: 6,
                                maxlength: 20,
                                kullanici: true
                        },
                        SIFRE: {
                                required: true,
                                minlength: 6
                        },
                        V_SIFRE: {
                                required: true,
                                equalTo: #SIFRE
                        },
                        GIZLI_SORU: required,
                        GIZLI_SORUM: required,
                        GIZLI_SORU_CEVAP: required,
                        ADI: required,
                        SOYADI: required,
                        EMAIL: {
                                required: true,
                                email: true
                        },
                        V_EMAIL: {
                                required: true,
                                equalTo: #EMAIL
                        },
                        CEP_TEL1: required,
                        CEP_TEL2: {
                                required: true,
                                cep: true
                        },
                        DOGUM_TARIHI: {
                                dogum: true,
                                required: true
                        },
                        SEHIR: required,
                        SOZLESME: required
                },
                messages: {
                        KULLANICI_ADI: {
                                required: Kullanýcý adýnýzý giriniz,
                                minlength: jQuery.format(En az {0}
 karakter girebilirsiniz),
                                maxlength: jQuery.format(En fazla {0}
 karakter girebilirsiniz),
                                kullanici: Boþluk ve Türkçe karakter
 kullanýlmadan en az 6
 karakter,
                        },
                        SIFRE: {
                                required: Þifrenizi giriniz,
                                minlength: jQuery.format(En az {0}
 karakter girebilirsiniz)
                        },
                        V_SIFRE: {
                                required: Þifrenizi tekrar giriniz,
                                equalTo: Þifreler uyumsuz
                        },
     

[jQuery] Re: Jquery Validate Problem on IE (Need Help)

2009-11-14 Thread serhat
I really need a solution soon can any one check my code?

On 14 Kasım, 00:17, serhat serhatsarika...@gmail.com wrote:
 I also tried without $.validator.addMethod but still have the same
 problem... Any idea or fix for this validation script? Thx for any
 advise :)

 On 13 Kasým, 18:25, serhat serhatsarika...@gmail.com wrote:



  I have a form validation with Jquery+Jquery Validation Plugin. I tried
  all variations on my page but cant make it work on IE 6.0 , 7.0 or 8.0
  but both Firefox and Chrome works great. The code is;

  $(document).ready(function() {
         $.validator.addMethod(kullanici, function (value, element) {
                 return /^[a-zA-Z0-9]+$/.test(value);
         },Format);

         $.validator.addMethod(dogum, function (value, element) {
                 return /^(((0[1-9]|[12]\d|3[01])\/(0[13578]|1[02])\/
  ((19|[2-9]\d)\d
  {2}))|((0[1-9]|[12]\d|30)\/(0[13456789]|1[012])\/((19|[2-9]\d)\d{2}))|
  ((0[1-9]|1\d|2[0-8])\/02\/((19|[2-9]\d)\d{2}))|(29\/02\/((1[6-9]|
  [2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])
  00$/.test(value);
         },Tarih formatý Gün/Ay/Yýl olmalýdýr);

         $.validator.addMethod(cep, function (value, element) {
                 return /[0-9]{7}/.test(value);
         },Cep telefonu formatý yanlýþ);

         var validator = $(#Uyeolform).validate({
                 rules: {
                         KULLANICI_ADI: {
                                 required: true,
                                 minlength: 6,
                                 maxlength: 20,
                                 kullanici: true
                         },
                         SIFRE: {
                                 required: true,
                                 minlength: 6
                         },
                         V_SIFRE: {
                                 required: true,
                                 equalTo: #SIFRE
                         },
                         GIZLI_SORU: required,
                         GIZLI_SORUM: required,
                         GIZLI_SORU_CEVAP: required,
                         ADI: required,
                         SOYADI: required,
                         EMAIL: {
                                 required: true,
                                 email: true
                         },
                         V_EMAIL: {
                                 required: true,
                                 equalTo: #EMAIL
                         },
                         CEP_TEL1: required,
                         CEP_TEL2: {
                                 required: true,
                                 cep: true
                         },
                         DOGUM_TARIHI: {
                                 dogum: true,
                                 required: true
                         },
                         SEHIR: required,
                         SOZLESME: required
                 },
                 messages: {
                         KULLANICI_ADI: {
                                 required: Kullanýcý adýnýzý giriniz,
                                 minlength: jQuery.format(En az {0}
  karakter girebilirsiniz),
                                 maxlength: jQuery.format(En fazla {0}
  karakter girebilirsiniz),
                                 kullanici: Boþluk ve Türkçe karakter
  kullanýlmadan en az 6
  karakter,
                         },
                         SIFRE: {
                                 required: Þifrenizi giriniz,
                                 minlength: jQuery.format(En az {0}
  karakter girebilirsiniz)
                         },
                         V_SIFRE: {
                                 required: Þifrenizi tekrar giriniz,
                                 equalTo: Þifreler uyumsuz
                         },
                         GIZLI_SORU: Gizli sorunuzu seçiniz,
                         GIZLI_SORUM: Kendi gizli sorunuzu yazýnýz veya
  varolanlardan
  birini seçiniz,
                         GIZLI_SORU_CEVAP: Gizli sorunuzun cevabýný
  giriniz,
                         ADI: Adýnýzý giriniz,
                         SOYADI: Soyadýnýzý giriniz,
                         EMAIL: {
                                 required: Email adresinizi giriniz,
                                 email: Lütfen geçerli bir email adresi
  giriniz
                         },
                         V_EMAIL: {
                                 required: Email adresinizi tekrar
  giriniz,
                                 equalTo: Email adresleri uyumsuz
                         },
                         CEP_TEL1: Lütfen operatör numaranýzý seçiniz
  brbr,
                         CEP_TEL2: {
                                 required: Lütfen cep telefonu
  numaranýzý giriniz brbr,
                                 cep: Lütfen cep telefonu numaranýzý
  doðru giriniz brbr
                         },
                         DOGUM_TARIHI: {
     

[jQuery] Re: Jquery Validate Problem on IE

2009-11-13 Thread serhat
I also tried without $.validator.addMethod but still have the same
problem... Any idea or fix for this validation script? Thx for any
advise :)

On 13 Kasım, 18:25, serhat serhatsarika...@gmail.com wrote:
 I have a form validation with Jquery+Jquery Validation Plugin. I tried
 all variations on my page but cant make it work on IE 6.0 , 7.0 or 8.0
 but both Firefox and Chrome works great. The code is;

 $(document).ready(function() {
        $.validator.addMethod(kullanici, function (value, element) {
                return /^[a-zA-Z0-9]+$/.test(value);
        },Format);

        $.validator.addMethod(dogum, function (value, element) {
                return /^(((0[1-9]|[12]\d|3[01])\/(0[13578]|1[02])\/
 ((19|[2-9]\d)\d
 {2}))|((0[1-9]|[12]\d|30)\/(0[13456789]|1[012])\/((19|[2-9]\d)\d{2}))|
 ((0[1-9]|1\d|2[0-8])\/02\/((19|[2-9]\d)\d{2}))|(29\/02\/((1[6-9]|
 [2-9]\d)(0[48]|[2468][048]|[13579][26])|((16|[2468][048]|[3579][26])
 00$/.test(value);
        },Tarih formatı Gün/Ay/Yıl olmalıdır);

        $.validator.addMethod(cep, function (value, element) {
                return /[0-9]{7}/.test(value);
        },Cep telefonu formatı yanlış);

        var validator = $(#Uyeolform).validate({
                rules: {
                        KULLANICI_ADI: {
                                required: true,
                                minlength: 6,
                                maxlength: 20,
                                kullanici: true
                        },
                        SIFRE: {
                                required: true,
                                minlength: 6
                        },
                        V_SIFRE: {
                                required: true,
                                equalTo: #SIFRE
                        },
                        GIZLI_SORU: required,
                        GIZLI_SORUM: required,
                        GIZLI_SORU_CEVAP: required,
                        ADI: required,
                        SOYADI: required,
                        EMAIL: {
                                required: true,
                                email: true
                        },
                        V_EMAIL: {
                                required: true,
                                equalTo: #EMAIL
                        },
                        CEP_TEL1: required,
                        CEP_TEL2: {
                                required: true,
                                cep: true
                        },
                        DOGUM_TARIHI: {
                                dogum: true,
                                required: true
                        },
                        SEHIR: required,
                        SOZLESME: required
                },
                messages: {
                        KULLANICI_ADI: {
                                required: Kullanıcı adınızı giriniz,
                                minlength: jQuery.format(En az {0}
 karakter girebilirsiniz),
                                maxlength: jQuery.format(En fazla {0}
 karakter girebilirsiniz),
                                kullanici: Boşluk ve Türkçe karakter
 kullanılmadan en az 6
 karakter,
                        },
                        SIFRE: {
                                required: Şifrenizi giriniz,
                                minlength: jQuery.format(En az {0}
 karakter girebilirsiniz)
                        },
                        V_SIFRE: {
                                required: Şifrenizi tekrar giriniz,
                                equalTo: Şifreler uyumsuz
                        },
                        GIZLI_SORU: Gizli sorunuzu seçiniz,
                        GIZLI_SORUM: Kendi gizli sorunuzu yazınız veya
 varolanlardan
 birini seçiniz,
                        GIZLI_SORU_CEVAP: Gizli sorunuzun cevabını
 giriniz,
                        ADI: Adınızı giriniz,
                        SOYADI: Soyadınızı giriniz,
                        EMAIL: {
                                required: Email adresinizi giriniz,
                                email: Lütfen geçerli bir email adresi
 giriniz
                        },
                        V_EMAIL: {
                                required: Email adresinizi tekrar
 giriniz,
                                equalTo: Email adresleri uyumsuz
                        },
                        CEP_TEL1: Lütfen operatör numaranızı seçiniz
 brbr,
                        CEP_TEL2: {
                                required: Lütfen cep telefonu
 numaranızı giriniz brbr,
                                cep: Lütfen cep telefonu numaranızı
 doğru giriniz brbr
                        },
                        DOGUM_TARIHI: {
                                dogum: Doğum tarihinizi giriniz (Gün/
 Ay/Yıl),
                                required: Doğum tarihinizi formatı Gün/
 Ay/Yıl olmalıdır
                        },
                        SEHIR: Lütfen 

[jQuery] VALIDATE change errormessage

2009-11-12 Thread fyp
Moin,

sorry, i dont get it: how to change the error message for all fields
This field is required.

script type=text/javascript src=http://dev.jquery.com/view/trunk/
plugins/validate/jquery.validate.js/script

  script
  $(document).ready(function(){
$(#mainform).validate();
  });
  /script


thanks,
fyp


[jQuery] (validate) Using metadata attr type with validate plugin

2009-11-10 Thread Iwan Vosloo
Hi there,

We managed to get the validation plugin to work with metadata inside a
class attribute, but we would like to move it to its own HTML5 data-
xxx attribute. Our current efforts look like this:

   $.metadata.setType( attr, data );
   $(#commentForm).validate({meta: data});

with the HTML:

input id=cname name=name maxlength=5 minlength=2
required=*
  data={messages:{required:'Enter this!',minlength:'Too
short!'}}/

(we only want to put messages in there)

But this does not work. What are we doing wrong? Or, how can we tell
validate to use attr method for metadata?

(The following does work:)
input id=cname name=name maxlength=5 minlength=2
required=*
  class={messages:{required:'Enter this!',minlength:'Too
short!'}}/

Regards
- Iwan


  1   2   3   4   5   6   7   8   9   >