validate

jQuery - adding rules to validate() with grouping.

oi! another question. The form is at: http://fuzzysiberians.com/app4.cfm?a=1 I am using: $('#sec_ssn3').rules("add", { groups: { ssn:"sec_ssn1 sec_ssn2 sec_ssn3" }, required:true, number: true, messages: { required: " <span style='color:red;'>Please enter co-applicant's social security number</span>...

jQuery validate with a dynamic number of fields

I have a form with a stage that has a dynamic number of groups of fields, where the number is based upon answers in the previous stage. I'm generating the fields server-side as an array, i.e. <input id="foo[0]"... <input id="bar[0]"... <input id="foo[1]"... <input id="bar[1]"... <input id="foo[2]"... <input id="bar[2]"... etc No ma...

How can I validate enum types as Perl subroutine arguments?

Building off Does Perl have an enumeration type?, how can I perform dynamic type checking (or static type checking if use strict is able to do so) that my subroutine argument is getting the right type of enum? package Phone::Type; use constant { HOME => 'Home', WORK => 'Work', }; package main; sub fun { my ($my_phone_type...

invalid a href URL's

For example, I have a URL, that someone entered into a specific CMS form field, to display on the website: http://seneca.sunyconnect.suny.edu:4730/F/?request=79396&amp;func=find-b&amp;find_code=sys&amp;local_base=her01pub and it outputs the following html: <a href="http://seneca.sunyconnect.suny.edu:4730/F/?request=79396&amp;func=find-...

How do you create rules for jquery form validate plugin with names that are arrays?

Hi Does anyone know how to create the rules for the jquery form validate plugin when you have a name attribute that is an array? eg. <form id="myForm"> <input type="checkbox" name="data[]" id="firstId" value="1" />One <br /> <input type="checkbox" name="data[]" id="secondId" value="2" />One <br /> ... I'm trying to attach a rule to ...

Jquery Validate

Hi, I'm using jquery.validate.js on a form which is working as it should except for an area where users can choose between paying by cheque, or credit card. Depending on which option is chosen, a hidden div will show. By Cheque: <div class="accordionButton"> <label for="Cheque"><input onclick="javascript: $('#li_buttons').show('slow'...

How to customize error message of maxlength with jQuery validate to show number of entered characters

I want the maxlength validation of jQuery validate to display an error message like the following: "Please enter no more than {0} characters. You've currently entered {1} characters." Where {1} is a placeholder for the actual amount. What's the best way to do this? ...

jQuery name problem

Hi, i have a problem trying to validate something. I hope you can help me! IM USING STRUTS2 "currentTarjeta.causaDeUnicoServicioContratado": { required: "#currentTarjeta.causaDeUnicoServicioContratado:checked", i need to validate input "currentTarjeta.causaDeUnicoServicioContratado" when is checked the check "currentTarjeta.causaDeUni...

Whether You Can Call Validate Twice (How To Read The API in Rails)

I'm trying to figure out whether I can call the validate method twice in an ActiveRecord model definition. Once, of course, would be in a mixin. So the first question is, is it okay to put this method in a mixin: validate :check_them_dates and not worry if classes that include me will want to call validate as well? I have alread...

How to check if an element contains another element in jQuery

I am using xVal combind with the jquery.validate plugin, but have come across a slight problem in that it is posting validation messages twice in a certain instance. I think this bug should be fairly easily fixed with some clever jQuery in the placement of the error message. I am trying to find a way to see if a ul already contains an l...

How can I verify that user name starts with a letter and contains only alphanumeric characters?

I am using Jquery Validation. Currently, I have a username, what i want to validate for this username is: Not blank Availability No whitespaces, I add this method: $.validator.addMethod("nowhitespace", function(value, element) { return this.optional(element) || /^\S+$/i.test(value); }, " No white space please"); Alphanumeric ...

jquery validation rules.

My phone validation depends on a checkbox (no, don't contact me via phone). If this is checked, then I will not need run the phone validation. I googled around and found 'depends' function. I have $("#myForm").validate({ .... rules: { phone1: { required: { depends: "!#pri_noPhone:checked" }, number: true, minlength:3,...

CSS Validator - Ruby

Hey, I have the css-validator.war provided by W3C running locally on JBoss. I have whipped together a very quick script to test it out: require 'net/http' require 'uri' doc = ' * html { font-family: tahoma; background-color: black; } ' res = Net::HTTP.post_form(URI.parse('http://localhost:8080/css-validator/validator'), {'...

C# best way to "validate" an object bound to a form

Hello, I got a business object bounds to a form (each property is bound to a control). There is some business specificatios (such as this field should not be empty, this one must be greater than 0 etc...). What is the best way to check all the rules ? I currently have a validator on each contorl, so I can check for all validator to be ...

jquery validate single key callback

Hi, I'm using jquery validate to validate my forms. I want to show a text field that is hidden when my This field is valid. That is i want call a method when a text field is valid(on text field change, before clicking submit). Any ideas? ...

jquery validate bind blur event

Hi, I'm using Jquery validate plugin.I need to validate two fields. I have some problems with the following code.I'm checking whether the given element valid and if it is valid I make an ajax call to check for few values and hide or show elements based on that. The problem is when the blur event happens, the validation is done. But th...

Validating data from a file in .NET

In my program (a console application that does edit and imputation of data) I give the user the ability to provide a data dictionary in a number of different ways: tab-delimited text files, Excel workbooks or in a database. The dictionary consists of several (12-15) files/sheets/tables. I am trying to come up with a nice way to load th...

XML Digital Signature validation

I was trying to validate an XML signature. The validation according to this tutorial works fine. But I also tried to a second approach. To verify it with the verify method of the Signature class I extracted the signature and the certificate from the xml file, and I did the following: public static boolean checkSignedFile(byte[] ...

asp.net validate textbox - at least one text box must have data in

I have three textboxes and I want to validate them. At least one textbox must contain data. How can I do this? (The textboxes are Home Phone No., Work Phone No., Mobile No. and I need to check at least one method of contact is specified) ...

Checking that at least 2 of the 5 lines exist on an address in XSL 1.0 before outputing the address node

I'm trying to create an address that validates against a schema set in stone, it requires that at least 2 of the 5 lines have been entered. Only show address node if at least two of the five lines are available. Is there a way I can check this using XSL The input looks like this: <Services Street="1 The Road " ExtraAddress="The Stre...