[jQuery] [jQuery-Form-Validator] - Problem with rules

2010-02-06 Thread niagara
Hi guys.
This is my code:
$().ready(function() {
$(#previ).validate({
submitHandler: function() {
 if(confirm('Sure?')){
$(form).submit();
return true;
  }else{
 return false;
 }
},
rules: {
id_previsione: { required:  true },
id_icona: { required: true },
id_regione: { required: $('#id_previsione').val() == 1 
}, //NOTE
THIS ROWS -
testo_previsione: { required: true  }
},
messages: {
id_previsione: { required: is required.. },
id_icona: { required: is required...},
id_regione: { required: is required...},
testo_previsione:  { required: is required., }
}
});
});

I don't riceve any error but it doesn't work as i expected.
I want that the rules id_regione { required: true } is applyed when
the val of id_prevision is == 1.
Understand my problem?

Many Thanks.
Best regards.


[jQuery] Re: Validate jquery plugin problem

2010-01-20 Thread Niagara
No error bat if i insert a valid captcha, show label error with '1'.
If i insert a fake captcha, show label error correctly.
The part of code is:
  antispam_captcha: {
required: true,
remote: /metwit/comuni/action.php
},
Thanks.


On 19 Gen, 22:49, Nathan Klatt n8kl...@gmail.com wrote:
 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 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