validation

Why are my Validation Rules not being run when DataContext is set?

I have the following Loaded event on my Window: void Window_Loaded(object sender, RoutedEventArgs e) { this.DataContext = new MyObject() { MyDateTime = DateTime.Now, MyNotEmptyString = "Not Empty", MyNotUpperCaseString = "not upper case", MyInteger = 20, MyIntegerInRange = 1, MyDouble ...

Django. Confirming user creation by mail.

I want to create django users from django application, and then confirming user creation by sending them e-mail with validation link. How can I safely generate this link from user details (I don't want to generate random value and store it in DB, and I don't want to use any external modules like Pinax for this) ...

asp.NET MVC Model State Validation Issues

I am having issues adding validation methods to a couple of controls in my MVC app. I use the following to test for the mm/dd/yyyy format: if (!Regex.IsMatch(candidateToEdit.availability.StartDate.ToShortDateString(), @"giantregex")) ModelState.AddModelError("availability_StartDate", "Start date must be in the mm/dd/yyyy for...

Validate Phone Number Existence for United States

Hi, I wanna validate a given phone number for United States in C#. Is there any API or something for that which helps programmers to validate phone numbers existence. I don't wanna only validate if they're matching the format of phone numbers for USA but also their existence. Thanks in advance. ...

Best practice entity validation in ASP.NET MVC & ADO.NET Entity Framework

Hi, i am using ASP.NET MVC & ADO.NET Entity Framework in a project. I want to add validation logic to my entities via partial classes. It works similar like shown in the NerdDinner.com ASP.NET MVC Application which is using LINQ2SQL. The main difference is, that i have to use the"OnPropertyChanging" event instead the "OnValidating" like...

Using IDataErrorInfo and setting Validation.HasError style

Hi, In WPF using IDataErrorInfo and Style I want to create form where I can provide end user three different status while validating data To make scenario more clear 1) I have textbox next to it I have icon which provides end user what kind of input textbox expects - Initial status with information icon 2) As soon as user enter data ...

Which is more correct: using UpdateModel() or receiving a model as a parameter?

I've seen numerous examples of create actions in articles, books, and examples. It seem there are two prevalent styles. [AcceptVerbs(HttpVerbs.Post)] public ActionResult Create(FormCollection collection) { try { var contact = Contact.Create(); UpdateModel<Contact>(contact); contact.Save(); ...

ASP.NET CheckBoxGroup - Validate user chooses at least one checkbox

I've got a checkbox group control that I want to require the user to check at least ONE box, it does not matter if they check every single one, or 3, or even just one. In the spirit of asp.net's validation controls can I use to enforce this. I'm also using the Ajax validation extender, so it would be nice if it could look like other con...

Validate Plugin - using the submitHandler

My apologies if you have already seen this or replied to it but I can't seem to find the question I originally submitted and i'm desperate for a solution. I need to display a promotional message when the user clicks submit if they meet certain criteria about their postcode. I have heard that you should use the submitHandler but being...

Validation for selected row in JSF h:datatable

Hi all, I am having a tough time trying to find a solution to the following design related to h:dataTable. I have certain number of rows predisplayed. The first column is only checkboxes. The rest of the columns are disabled by default. On selecting a checkbox the elements in the corresponding rows get enabled. On submit of the for th...

Advanced Date-Validation with PHP

I've got to validate numerous dates with my current project. Unfortunately, these dates can vary wildly. Examples include: 1983-07-10 (After 1970) 1492-10-11 (Before 1970, year of Unix Timestamps - this eliminates strtotime() on some systems) 200 B.C. (Really old...) Dates will not exceed 9999 b.c., nor will they be future (beyond 't...

AJAX Rails Validation

I have my form and validation working great with regular http requests. I would like it to use AJAX. I know i can validate on the client side but that seems redundant given that I have defined the validations in my model. As the user is filling out the form, I'd like to give feedback to them on their entries. What is the best way to ...

Advice on JQuery UI Dialog

On my form I need to perform a task where a message appears if a users matches the criteria of being entered in to win a prize. Basically if they have a certain postcode then this message needs to appear. If they don't then the message doesn't appear. I need this to happen when they click submit. I have written a regex for the postcodes....

Validation, javascript

I have this code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title>sss</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <script type='text/javascript'> functi...

ASP.Net PostbackURL doesn't work if I put in Javascript Validation

I have a usercontrol in ASP.Net featuring a button that I use to postback. This button also has some Javascript validation that is done before it processes the event. Today I tried to postback to another URL by setting the PostBackURL property of the button. But it didn't work and the page kept posting back to itself. So I did some inve...

Validating a software for copy protected reasons

Hey, I'm trying to see what are the few good ways to validate my software. I generate a key for each buyer and then want to make sure that key is used only once, and they can't install the app on other computers and use the same key. Does anyone have any good suggestions? Thanks, ...

Change the position of the textbox validation

The new data validation in silverlight 3 has a red textbox that flies out to the right. This is a problem for me because I have have a textbox to the right that is getting covered by the popup. How can I make this popup move somewhere else? ...

Multiple messages for single JSF Validator

Hi all, I have run into a blocking scenario and need help. The problem is basically this: There is a field on the page which is attached to a validator. This validator in turn validates other fields in particular relation and should throw error messages for all the related fields that have failed validation. So basically I want a sin...

What's the state of the art in email validation for Rails?

What are you using to validate users' email addresses, and why? I had been using validates_email_veracity_of which actually queries the MX servers. But that is full of fail for various reasons, mostly related to network traffic and reliability. I looked around and I couldn't find anything obvious that a lot of people are using to perf...

What is the correct way to validate the arguments of a constructor

So I have a class with a single string parameter in its constructor: public MyClass(string name) { this.Name = name; } but I never want to worry about some one initializing an instance of MyClass with name that is NULL or a zero length string. What is the best was to validate the parameter? With a property or method you can always...