validation

ASP.NET MVC2 Custom jQuery validation: client -side

Hi. I want to create a validation rule for 2 date-pickers (startDate less then endDate). I create a validation attribute: [AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)] public sealed class DateCompareAttribute : ValidationAttribute { private const string _defaultErrorMessage = "'{0}' is less then '...

Validation errors are visible when I access the page before I post the form

Hi, I have html validation using client side and server side validation. The problem is when I open the page the validation text is visible before I fill in the text box and post the form. What can I do the solve this issue? I'm using the following code: <script src="/Scripts/jquery-1.4.1.min.js" type="text/javascript"></script> ...

DataGrid validation of DataServices data - how??

Hi, I'm trying to display data from WcfDataService (VS2010) in WPF DataGrid. Everything works. except of normal validation. I was trying to make validation both with default WPF validation and IDataErrorInfo, but I can't get working all features I need. That is list of problems and questions: 1) How to disable DataGrid built-in check f...

Is it possible to use template tags in ValidationError's strings?

I need to throw ValidationError containing anchor. if not profile.activated(): raise ValidationError('Your profile is not activated. <a href="{% url resend_activation_key %}">Resend activation key</a>.') What I need to modify to make this work? ...

validates_each user_id & question_id stops collection of user_id but not creation of record...

I am trying to limit a user of my application to voting (liking in this case) a an answer to a question a particular number of times. I am successfully stopping the collection of the user_id but the record keeps getting created. I need for the validation to actually block the creation of the record in the likes table. As you can see ...

How does one validate an entire site?

I realize there's the W3C validator, which works great for one page. There's also the perl install they provide, but it seems to not work on a Mac or it's buggy. Given that 1) I have an entire set of local files How do I a) Validate the entire set b) do it behind a firewall c) do it simply without installing anything on my compute...

Regular expression for validating month

What is the regular expression for validating a month with the leading zero? Passes regular expression: 01,02,03,04,05,06,07,08,09,10,11,12 Fails regular expression: 1, 00, 13 and up. ...

jQuery: How to check if a value exists in an array?

Hello, I am trying to write a simple input field validation plugin at the moment (more of a learning exercise really) and thought this would not be too hard, seeing as all I should have to do is: Get input fields Store them in array with each one's value On submit of form check if array contains any empty strings But I seem to fail ...

jQuery - Iframe validation - cannot get values

See demo: http://tinyurl.com/3xow97t The editor is under development. Now we check if it has an value - this works well with all form fields that have the class .required... but it does not work with the iframe. the iframe has a div with id #content. $('form .meet').focus(function() { $('iframe').each(function() { ** if($(this...

which RDBMS or other tool provides good SQL syntax error messages?

I use MySQL and it gives no meaningful error messages beyond "syntax wrong close to something or other". This is in sharp contrast to the sort of nice, clear error messages we are used to getting from java compiler and similar. So, are there RDBMS or sql validation tools that provide clearer, meaningful error messages? ...

ASP.NET validation controls

Hi All, I want to use Validation Controls but I dont want them to show their Error Messages when invalid data exist. Instead I'm going to iterate through the validation controls and show error messages inside my little ErrorMessage Control for (int i = 0; i < Page.Validators.Count; i++) { if (!Page.Validators[i].I...

Where to put data management rules for complex data validation in ASP.NET MVC?

Hello, I am currently working on an ASP.NET MVC2 project. This is the first time I am working on a real MVC web application. The ASP.NET MVC website really helped me to get started really fast, but I still have some obscure knowledge concerning datamodel validation. My problem is that I do not really know where to manage my filled data...

jQuery Dialog doesn't display code from .appendTo in IE6

I'm using jQuery's validation on a form. When the form is validated, I'm using a submitHandler to fill a dialog with data from the form then I open the dialog to display it. Works great except for in IE6. Nothing displays. I've tried initializing the dialog before and after running the validation code but neither makes a difference. ...

WPF DataGrid - Validation Recommendations

Hi All, We are implementing a WPF business application using MVVM. Currently we are trying to determine the best way to show validation errors for DataGrids. Currently we are trying to do so like this: 1) A View user control contains a datagrid bound to an EntityCollection of Entity Framework objects located in the associated ViewMod...

I need to add a range for a date input field in jquery

I've got an input field in a form that needs a date value. I'm using jQuery UI's datepicker for the calendar and I've set a range for it. However, the user can override that by typing a different date in the input field. How can I specify a date range for the field with jQuery validation? All I see with jQuery is that you can only sp...

Using unless in rails uniqueness validation

I am just starting out in Rails, and trying to develop a simple application. I need to validate three values submitted to the application - each must meet the same validation criteria. The validation is pretty simple: Value is valid if unqiue, null or equal to "p" or "d". The following gets me halfway there: validates_uniqueness_of :...

Common DataAnnotations in ASP.Net MVC2

Howdy, I have what should be a simple question. I have a set of validations that use System.CompontentModel.DataAnnotations . I have some validations that are specific to certain view models, so I'm comfortable with having the validation code in the same file as my models (as in the default AccountModels.cs file that ships with MVC2). ...

Validate password on change of certain fields in RoR

Hello, I am building a RoR 3 app, a community. It has a User model and some fields. So when a user is updating a certain field, like his/her birthday, I want to validate that the User typed in the password that is the same in the database. This way I know that it is the right user trying to change the birthday. So I ask you how i can c...

Why does false invalidate validates_presence_of?

Ok steps to reproduce this: prompt> rails test_app prompt> cd test_app prompt> script/generate model event_service published:boolean then go into the migration and add not null and default published to false: class CreateEventServices < ActiveRecord::Migration def self.up create_table :event_services do |t| t.boolean :pub...

Using user editable image URL in application. Security issues.

Hi there. I am writing an application where users are required to show their photo, however as my server resources are very limited I can not let them upload it to the server. So I have three major questions: 1. How to properly validate photo URL? At least I can validate with regexp, however I need to check for file ending: `validat...