I have created the file jquery.validateCopy.js and added with:
in my HEAD section.
Than I write:
jQuery.validator.addMethod("GetValue", function() {
return true;
}, jQuery.format("Please enter the correct value"));
in it.
Then I modify it with:
city: {
required: GetV
Nope, just add the code in some file, included after jquery.validate.js.
Jörn
On Tue, May 26, 2009 at 4:03 PM, ciupaz wrote:
>
> I must write it in the jquery.validate.js file?
I must write it in the jquery.validate.js file?
Custom methods are documented here:
http://docs.jquery.com/Plugins/Validation/Validator/addMethod
Jörn
On Tue, May 26, 2009 at 3:49 PM, ciupaz wrote:
>
> Yes, exactly, and I'm trying this custom method:
>
> function GetCityValue() {
> var value = $('#city').val();
> if (value == -
Yes, exactly, and I'm trying this custom method:
function GetCityValue() {
var value = $('#city').val();
if (value == -1) {
return true;
}
else {
return false;
}
}
and
..
city: {
required: GetCityValue()
You'd have to write a custom method for that. Or replace the value on
submit or something like that. The required-rule works with an empty
value.
Jörn
On Tue, May 26, 2009 at 3:22 PM, ciupaz wrote:
>
> Thank you Jorn, now with the "name" attribute it's working.
> A simple question.
> For busine
Thank you Jorn, now with the "name" attribute it's working.
A simple question.
For business rules I have to give the value "-1" to the "Select the
city" option.
Like this:
Select a city
Milan
Turin
Rome
The validation plugin uses the name-attribute. Your select has just an
id, no name. Add name="city" and it should be working!
Jörn
On Tue, May 26, 2009 at 2:20 PM, ciupaz wrote:
>
> Hi all,
> I have a simple combobox like this:
>
>
>
> Select a city
> Mila
8 matches
Mail list logo