validation

Data Validation Design Patterns

If I have a collection of database tables (in an Access file, for example) and need to validate each table in this collection against a rule set that has both common rules across all tables as well as individual rules specific to one or a subset of tables, can someone recommend a good design pattern to look into? Specifically, I would l...

Validate email address in Javascript?

What's the best way to validate an email address in Javascript? Though this solution may be simple, I'm sure this is one of those useful things that people will be Googling for and deserves its own entry on the site ...

How to Dynamically Generate String Validation?

Does anyone know of a library (preferably php) or algorithm for auto-generating regex's from some common descriptions? For example, have a form with the possible options of: Length (=x, between x & y, etc) Starts with Ends with Character(s) x(yz) at index i Specify one or more alternative behavior based on the above And so on.. The ...

Handling HttpRequestValidationException gracefully and ASP.net AJAX compatible?

ValidateEvents is a great ASP.net function, but the Yellow Screen of Death is not so nice. I found a way how to handle the HttpRequestValidationException gracefully here, but that does not work with ASP.net AJAX properly. Basically, I got an UpdatePanel with a TextBox and a Button, and when the user types in HTML into the Textbox, a Ja...

Would you override ScriptControl or BaseValidator for an async ASP.NET validator control?

I'm planning to develop an ASP.NET server control to provide asynchronous username availability validation for new user registrations. The control will allow a developer to point it at a "username" TextBox and it will provide an indication of whether or not the username is available. Like this example, but without the clunky UpdatePane...

PHP Multiform Validation and Redirection

I have buy.php with a form where you enter items, quantity, shipping data, etc. When you click the Submit button, it posts back to buy.php ($_SERVER['PHP_SELF']) and does some data validation. If there are fields missing or errors, they are highlighted. If everything is correct, I save the $_POST data in $_SESSION variables, then do a he...

What, if any, checksum is used for TNT.com tracking numbers?

I am writing some software to identify tracking numbers (in the same way that Google identifies FedEx or UPS numbers when you search for them). Most couriers use a system, such as a "weighted average mod system" which can be used to identify if a number is a valid tracking number. Does anyone know if TNT consignment numbers use such a sy...

ASP.NET Convert Invalid String to Null

In my application I have TextBox in a FormView bound to a LinqDataSource like so: <asp:TextBox ID="MyTextBox" runat="server" Text='<%# Bind("MyValue") %>' AutoPostBack="True" ontextchanged="MyTextBox_TextChanged" /> protected void MyTextBox_TextChanged(object sender, EventArgs e) { MyFormView.UpdateItem(...

MVC.net JQuery Validation

After trying to avoid JavaScript for years, Iv started using JQuery for validation in MVC asp.net, as there does not seem to be an official way of doing validation, Iv been surprised how good JQuery is. Firstly is there a way to get intellisense working for JQuery and its validation plugin, so that i don have to learn the api? Secondl...

Performing validation on a databound object after the property has been updated

I have a basic form with controls that are databound to an object implementing the INotifyPropertyChanged interface. I would like to add some validation to a couple of properties but dont want to go through implementing IDataErrorInfo for the sake of validating a couple of properties. I have created the functions that perform the valid...

WPF Data Binding and Validation Rules Best Practices

I have a very simple WPF application in which I am using data binding to allow editing of some custom CLR objects. I am now wanting to put some input validation in when the user clicks save. However, all the WPF books I have read don't really devote any space to this issue. I see that you can create custom ValidationRules, but I am wonde...

MVC validation, will it conflict with other JS frameworks?

Hi, If I want to use the validation framework that you can use with ASP.NET MVC, will the javascript conflict with other javascript frameworks like jquery or YUI? ...

How do I Validate the File Type of a File Upload?

I am using <input type="file" id="fileUpload" runat="server"> to upload a file in an ASP.NET application. I would like to limit the file type of the upload (example: limit to .xls or .xlsx file extensions). Both JavaScript or server-side validation are OK (as long as the server side validation would take place before the files are bein...

Using Javascript, how do I make sure a date range is valid?

As the title states, using Javascript, how can I valid two given dates to ensure that they are a valid range? For example, if you have the date 1 January 2010 and the date 6 January 2010, what is the best way to check to see if 6 January 2010 is within seven days of 1 January 2010. ...

Infopath 2007 - How do I perform data validation on the current view ONLY?

I have an infopath 2007 form that I am developing which uses 3 different views. The 3 different views are basically the same form, but have different text boxes shown, depending upon what button the user selects. I run into a problem where 'view 1' has some form validation, but the user has selected 'view 2' and submits it. The form val...

Java JFormattedTextField for typing dates

Hi! I've been having trouble to make a JFormattedTextField to use dates with the format dd/MM/yyyy. Specifically, as the user types, the cursor should "jump" the slashes, and get directly to the next number position. Also, the JFormattedTextField must verify if the date entered is valid, and reject it somehow if the date is invalid, or...

CausesValidation is set to "False" but the client side validation is still firing

I have several RequiredFieldValidators in an ASP.NET 1.1 web application that are firing on the client side when I press the Cancel button, which has the CausesValidation attribute set to "False". How can I get this to stop? I do not believe that Validation Groups are supported in 1.1. Here's a code sample: <asp:TextBox id="Userna...

Is there an elegant way to compare a checkbox and a textbox using ASP.NET validators?

I have an Asp.Net repeater, which contains a textbox and a checkbox. I need to add client-side validation that verifies that when the checkbox is checked, the textbox can only accept a value of zero or blank. I would like to use one or more of Asp.Net's validator controls to accomplish this, to provide a consistent display for client s...

In AIML, what's the XSD-valid way to use the element <set name="it"> ?

In file Atomic.aiml, part of the annotated ALICE AIML files, there are a lot of categories like this: <category> <pattern>ANSWER MY QUESTION</pattern> <template> Please try asking <set name="it">your question</set> another way. </template> </category> This code isn't valid according to the AIML...

Business Objects, Validation And Exceptions

I’ve been reading a few questions and answers regarding exceptions and their use. Seems to be a strong opinion that exceptions should be raised only for exception, unhandled cases. So that lead me to wondering how validation works with business objects. Lets say I have a business object with getters/setters for the properties on the obj...