validation

Validate measurements with PHP

I need to validate measurements entered into a form generated by PHP. I intend to compare them to upper and lower control limits and decide if they fail or pass. As a first step, I imagine a PHP function which accepts strings representing engineering measurements and converts them to pure numbers before the comparison. At the moment ...

Silverlight Validation - Optional Fields

Has any one used data validation on fields that are optional (nullable types)? I.e. the field can be empty, but if data is entered, it must be valid? Thanks, Mark ...

What ways are there to validate PHP code?

What ways are there to validate PHP code? I have tried the PHPEclipse plugin which works well but I would like to use a web-based one which is easier to access and use if there is any or maybe a smaller application. Ideas, tips, hints anyone? ...

jQuery Validate - require at least one field in a group to be filled

I'm using the excellent jQuery Validate Plugin to validate some forms. On one form, I need to ensure that the user fills in at least one of a group of fields. I think I've got a pretty good solution, and wanted to share it. Please suggest any improvements you can think of. Finding no built-in way to do this, I searched and found Rebecc...

Change textbox's css class when ASP.NET Validation fails

How can I execute some javascript when a Required Field Validator attached to a textbox fails client-side validation? What I am trying to do is change the css class of the textbox, to make the textbox's border show red. I am using webforms and I do have the jquery library available to me. ...

jQuery form validation plugin dependency-callback

I am using this jQuery form validation plugin: http://docs.jquery.com/Plugins/Validation/Methods I am trying to use the dependancy callback: http://docs.jquery.com/Plugins/Validation/Methods/required#dependency-callback What I am trying to do is only require "BAR" when "FOO" has a certain value. Here's a basic example: <select name="...

How to Check a (Canadian) SIN is a genuine SIN?

A Canadian SIN is equivalent to American SSN. I am not asking for the algorithm to check if any given 9-digit number passes the validation of the Luhn validation. The problem I have is some users are smart enough to generate a fake SIN that can pass the above validation, but the SIN would not exist in the government database. Theref...

client-side text-box character limit validation using jQuery?

I have a textbox that must have a MIN number of characters as well as a MAX number of characters. What is the best way, using jQuery, to make sure that the input is within the range (while displaying status messages to the user) before allowing the user to submit the form? Update: the code below works to some degree, however I am getti...

url validation using javascript

Hi, I want to validate url and want to display message. Below is my code. $("#pageUrl").keydown(function(){ $(".status").show(); var url = $("#pageUrl").val(); if(isValidURL(url)){ $.ajax({ type: "POST", url: "demo.php", data: "pageUrl="+ url, success: function(msg){ if(msg == 1 ){ ...

Validate that string belongs to specific language alphabet

How can I validate Rails model string attribute that it belongs to specific language alphabet characters? Thanks. ...

Grails domain class validator, property must be greater than another property

Hi folks, I have the following domain class in my grails project: class Vacation { Date start Date end User vacationer static constraints = { start(validator: {return (it >= new Date()-1)}) } } Is it possible to add a validator that requires end to be equal or greater than start? Cheers ...

ASP.NET-MVC Header-Fields and Error Correction

2 part question: 1. How does ASP.NET MVC deal / store || ignore malformed headers?? - e.g. if a proxy or security app tweaking: Accept-Encoding: gzip,deflate to be -> X-cept-EncodXng: gzip,deflate As when this happens, I am currently unable to respond optimally – which leads to part 2: 2. Are there any stand...

How [and where] implement a validation using ModelBinder.

Hello. I'm developing a little site using ASP.NET MVC, MySQL and NHibernate. I have a Contact class: [ModelBinder(typeof(CondicaoBinder))] public class Contact { public virtual int Id { get; set; } public virtual string Name { get; set; } public virtual int Age { get; set; } } And a Model Binder: public class Contac...

WPF: Clearing all errormessages in an elegant way

Hi, I'm a complete beginner at WPF. I've made a usercontrol "labeledTextbox" that holds a label, a textbox and a textblock for errormessages. When the user hits the submit button, I call SomeValidationMethod() to validate the user input. When one of the textboxes contain invalid data, I pass the errormessage to the corresponding user...

Use size constraint with Integer in Grails

The reference doc says that the size constraint: "Uses a Groovy range to restrict the size of a collection or number or the length of a String." When I put a size constraint on an integer, I get a warning "Property [prop] of domain class TheClass has type [java.lang.Integer] and doesn't support constraint [size]. This constraint will n...

How can I check for the correct location of commas in a number entered by a user?

I'm looking for a good way to check a number that a user has entered for correct position of an optional comma(s). For example 1,000,000.00 = correct 1000000 = correct 1,00,000.00 = incorrect ,100,000 = incorrect So it looks like i need to check to see that there is at least one number to the left and 3 numbers to the right of the com...

Validate Property With Attribute (Alternative to Enterprise Lib Validation Block)

Are there any alternative to Enterprise Library Validation Block? I want to be able to add validation attributes to my properties. Thanks ...

How to display error message on model in rails

Hi, I need to display error message on model in rails, my coding on model is like this, if my_address.valid? # I need here the validation error. return nil end I used errors.add("Invalid address") but it is not working please help to solve this problem , ...

Why is my validation message generic? ASP.NET MVC

Hello SO: I wrote a custom validation handler for this ASP.NET MVC application. Here is a screenshot of the validation messages: As you can see, the title and director work fine but the date does not. The code I have for the Create view: <fieldset> <legend>Fields</legend> <p> <%= Html.Label("Title", "Title:") %> <%...

How to validate HTML with RSS?

I'm trying to get up to speed on HTML/CSS/PHP development and was wondering how I should validate my code when it contains content I can't control, like an RSS feed? For example, my home page is a .php doc that contains HTML and PHP code. I use the PHP to create a simple RSS reader (using SimpleXML) to grab some feeds from another blog ...