validation

How to force a control to validate itself?

Hi, I've a winforms with some controls and an ErrorProvider. The control's Validating events are used to validate the data and report the error to the ErrorProvider if there is any. This work great when the user enter wrong informations into the control and leaves the control. However, the validation does not happen if the user click o...

Parameterize ValidationRule in WPF

I've only scraped the surface of validation in WPF and have come across a scenario that is likely fairly common: I have a TextBox whose value needs to be validated against a variable data type, depending on the context. For example, if the context's data type is 'int,' then the TextBox needs to accept only input that can be converted to ...

How to validate a select tag in struts 2 framework

Hi people, I am a newbie into programming and i am currently employed as a junior programmer. I am currently having some problems validating the select tags in one of my forms. What i actually trying to do is to ensure that one item is selected before the user submits the form . In the form i have; <s:select list="assessmentTypes" head...

Fix a warning thrown by HTML Validator

Hi I have some JavaScript code in my php website. This code uses jQuery, and builds a < select > menu using ajax calls. Here is the code sel.append('<option value="' + data[i].id + '">' + data[i].nombre + '</option>'); And this gives me the following warning line 240 column 82 - Warning: '<' + '/' + letter not allowed here Does any...

Is IDataErrorInfo ignored during model validation in MVC 2?

I currently migrated my project to MVC 2 and IDataErrorInfo doesn't seem to work when using default model binding and validation. Is it cut out? ...

How to handle Focuschangelistener in blackberry for this situation?

I am having three EditField i have a set focuslistener for the second editfield alone. when the focus is lost i am checking whether the field is empty or not if the field is empty it will show the popup message .Now the problem is once the user came to that field he could not move to other fields without entering any fields but i want us...

Ruby on Rails ActiveRecord Validation

I would like to validate attributes in a function like this class User < ActiveRecord::Base validate :check_name( :name ) def check_name( name ) ... if name is invalid ... self.errors.add( :name, 'Name is invalid') end end Can you please write the right code? Please explain the functionality why... THX! ...

Configuration Validation

I'm implementing a somewhat complex configuration section for a system monitoring project: <monitoring> <components> <component name="Remote Server" statusProviderType="ClientEndpoint" statusProviderName="endpoint1" /> </components> </montioring> <system.serviceModel> <client> <endpoint name=...

Name Hypocorism List

Does anybody know of a public list of name hypocorisms (a contracted form of a given name, such as Tony from Anthony, Rosy for Rosemarie or Vicky from Victoria)? ...

XmlDocument not performing validation?

I have this function for validate xml messages against external schema file: private bool IsValidMessage(string message, XmlDocument xDoc) { this.valid = true; byte[] bytes = Encoding.UTF8.GetBytes(message); MemoryStream ms = new MemoryStream(bytes); ms.Flush(); ms.Position = 0; XmlReaderSettings xSettings ...

using same ascx control twice while using Register (ASP.NET)

I'm using Register at the top of the page to register an ascx control, now the thing is I want to use this control twice on the page. Now, the problem is when I hit buttons of one instance of the control, it fires the validation of both of the controls, and it obviously breaks, because it should be validating only one control - itself!...

JQuery Validation - Show/Hide a label rather than use its message

Hi, I can't figure out the errorPlacement method of the jQuery validation plugin - for use with my checkboxes anyway. I want to just make the script show/hide a label if there's an error. Does anyone know where I put my code to be triggered when the validation finds an error? I think I can use success: to make it hide the label. This ...

Whitespace validation error message

Hi This may not be very technical, but in my application I want to prompt the user when the form input element value has whitepsaces only. My english grammar is not the best so I hope some of the better english speaking folks can help me with this sentence: alert("This field can not contain whitespaces only: " + labelName); Thanks ...

wpf ValidationRule question

Hello I am having trouble firing a validation rule in the context laid out below. From a visual standpoint I have a DataGrid with columns for every day of the week where a user can enter the number of hours worked on a given activity. There are also labels to display the total hours entered for each day, as well as for the week. It is ...

HTML validator for Win32?

Does anybody know a fast, free local HTML validator to copy-and-paste code in, that shows errors directly on their respective lines? ...

SQL to standardize/clean up First/Middle/Last name fields

I'm writing a function in SQL that we can use to validate First/Middle/Last names we have in a given table. At the moment I'm working on a list of ascii codes for characters that I'm going to consider invalid and strip out of the input. My plan is to create a table which contains the character codes of those characters I consider to be...

Masking &amp; for AJAX requests

This is a follow-up to a question I asked a few weeks back. The following: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt; <html> <head> <title>Test</title> </head> <body> <a onclick="start_ajax_request('url.php&key1=val1&key2=val2&key3=val3')">Test</a> </body> </html> ...

How to add non-standard attributes in a valid way

Is there a way to have non-standard attributes like onselectstart oncontextmenu ... in a tag, and still pass validation as HTML 4.01 transitional somehow? Apart from adding the properties later on using Javascript. ...

wpf error validation when binding is not two-way

Hi Guys I have a read only control that displays a calculation from other information in a datagrid. The binding it has works as far as displaying updated data as cell entries are made. I do need to show visually when the calculation is above a given threshold. It is a read-only control (label, actually) though. How can I go about doin...

Validate 2 lists using FluentValidation

Hi, if anyone has much experience using [C#] FluentValidation and has any ideas for the below question any help would be much appreciated. I have 2 Generic Lists (both with string datatype) - "Name" and "Url". They both have the same amount of items, thus indexed items match up i.e., Names[0] correlates with Urls[0]. The only problem I...