validation

XML validation against given DTD in PHP

In PHP, I am trying to validate an XML document using a DTD specified by my application - not by the externally fetched XML document. The validate method in the DOMDocument class seems to only validate using the DTD specified by the XML document itself, so this will not work. Can this be done, and how, or do I have to translate my DTD t...

Problem with validation in Excel

I have this code: Private Sub OptionButton1_Click() If OptionButton1.Value = True Then Application.EnableEvents = False Application.DisplayAlerts = False ActiveSheet.Unprotect ("ALS rules!") With ActiveWorkbook.ActiveSheet.Range("A18:A1269").Validation .Delete .Add Type:=xlValidateList, AlertStyle...

Will xVal work if the attributes are defined on Interfaces?

I'm wondering if anyone knows if xVal will work as expected if I define my system.componentmodel.dataannotations attributes on interfaces that are implemented by my model classes, instead of directly on the concrete model classes. public interface IFoo { [Required] [StringLength(30)] string Name { get; set; } } and then in my ...

How to display validation errors on a page with multiple forms in ASP.NET MVC

I have a top-level page called ReceiveItem. Within that page, I have a couple different FORMs - only one of which will be filled out and submitted (depending upon how that item is received). This all works quite well from the UI perspective. Here is the general page structure: <ReceiveItem.aspx> <ReceiveNewInventory.ascx> <Recei...

UTF-8 validation in PHP without using preg_match()

Hi, I need to validate some user input that is encoded in UTF-8. Many have recommended using the following code: preg_match('/\A( [\x09\x0A\x0D\x20-\x7E] | [\xC2-\xDF][\x80-\xBF] | \xE0[\xA0-\xBF][\x80-\xBF] | [\xE1-\xEC\xEE\xEF][\x80-\xBF]{2} | \xED[\x80-\x9F][\x80-\xBF] | \xF0[\x90-\xBF][\x80-\xBF]{2} | [\xF...

ErrorProvider(from Windows Forms) for ASP.net & linq-to-sql ?

I am trying to figure out how to notify the user which field failed to validate. I setup LINQ to SQL class datacontext to access a database from ASP.net pages. Since user input will be from by web interface forms and import from Excel files, i would like the write the validation logic in one place. The idea behind this is when i import f...

Display a custom error message in asp.net ?

Hi all.. Using asp.net validators, I'd like a control similar to the validation summary, except that it should only have 2 states: Hidden or showing a static message. When the page is valid, it should be hidded, and when it's not it should be showing the message :) Is this possible using the built-in controls of asp.net? (Bear in mind...

making a windows forms validation library for own use

I wish to make controls like textbox, combobox, listbox and other user editable controls to be bound with validation, so i thought of extending the existing controls and make a new VTextBox, VComboBox, VListBox which have a validationregex property and an error provider component attached with them. My prime aim is to have validation att...

rails validating multiple child models in a complex form

Hi, I am using multiple child models in a complex form (a la http://railsforum.com/viewtopic.php?id=28447). The form works great, but I need to validate a property of the set of child models before accepting the form data into the database. I've come up with one mostly-working, very-kludgy way of doing this. Seems like there has to be a...

Struts 2 validation

Can anyone please let me know how to check if start date > end date in Struts 2 validation.xml ...

NHibernate - problems with validation and transactions

I'm using NHibernate as my ORM. I have a situation where I have some stuff wrapped in an ITransaction. I am listening to the SaveUpdate event in NHibernate and then doing my entity validation in that SaveUpdate handler. For one of my entities, I want to validate that the value of a certain property hasn't changed. So I figured that I...

C# Custom Object Validation Design

I currently have to validate custom Field Objects for my application. Simply put, each Field object consists of information about the validation for the field, as well as the value of the field. I am validating fields in bulk, so currently, I have a validation class, that has a method for each validation. For required fields, it looks so...

ASP.NET - Client-Side OnClick Event of Button is Breaking Page Validation

I have a button on a form that saves a unique value to my database and to prevent the user from submitting twice and getting an error I added some JavaScript logic to do a client-side disable of the button after it is clicked. Functionally this all works, but it created an unexpected side effect that field Validation is being fired on a...

Pre-validating website users via a remote site

Hi, I need to work out a way to setup the validation of the users of a web application before they've actually arrived at the site. That is, someone browses to a url, enters a username and password which is then validated against a db or whatever. They are then automatically redirected to the real web application, on a different domain ...

jQuery check mysql database if username is already taken

Hi, i know that this is possible but i am confused as to how it works. I have been looking online for how it is done and I think i am missing something in the process I have this jQuery code so far: $("#Contact_Info").validate({ rules: { username: { required: true, minlength: 6, ...

Validate XPath expression

I would like to validate a user-provided XPath query to ensure that it is syntactically correct. Does it make sense to "validate" an XPath query without an XML document? How can i achieve such a thing in libxml? ...

Help with regex validation on string of text in c#

Hi, im trying to validate a string of text that must be in the following format, The number "1" followed by a semicolon followed by between 1 and three numbers only - it would look something like this. 1:1 (correct) 1:34 (correct) 1:847 (correct) 1:2322 (incorrect) There can be no letters or anything else except numbers. Does anyo...

How To Prevent Duplicate Email Addresses on a User Registration Form?

I want to prevent duplicate email addresses during registration. How would I go about validating the text box on entry so that the same email address won't be accepted twice? ...

How do I change the way Django displays error messages created during validation?

I love how Django performs form validation. However, I want to override the way the errors get displayed. I want to send form validation errors to the top of my web page (to a specific div tag) instead of letting Django display errors next to the form fields that are invalid. Any suggestions? ...

c# function, validate url within mvc app

I'm trying to build a function within my mvc app that will validate the user's url input. in my code below, i get the "not all code paths return a value." I need help figuring out why it doesn't like when i return result. thanks! public static long InsertUrl(string inputUrl) { long result = 0; if (!string...