validation

Appropriate use of DL and DD?

I had some site templates designed for me recently. I got the final HTML code, which validates, but the structure of the document is laid out using DL-DD pairs: <dl> <dd class="some-class"> Some text. </dd> </dl> I'm not especially familiar with those tags as I've never used them much, but they don't seem intended for document...

Can I use eclipse xml validator in a jsp?

I'm writing an application that outputs xml and I'm using a jsp to do it (in eclipse). It works fine, but the jsp editor complains about the xml tags. Is there a way to convince the jsp editor to validate xml instead of html? ...

GetLocalValueEnumerator() Not Returning All Properties

I am trying to perform validation in my WPF application using the solution in Detecting WPF Validation Errors. public static bool IsValid(DependencyObject parent) { // Validate all the bindings on the parent bool valid = true; LocalValueEnumerator localValues = parent.GetLocalValueEnumerator(); while (localValues...

Javascript form validation

Hello, I'm trying to figure out what would be the simplest way to validate required fields without having to do an if statement for each element's name. Perhaps just with a loop and verify its class. What I'm trying to accomplish is to check only the ones that have the class name as "required" <input name="a1" class="required" type="te...

Does RegularExpressionValidator use other flavor than Regex?

I want to do preliminary check if entered string looks like Vehicle Identification Number (VIN). I know what it consists of 17 letters and digits, but letters I, O and Q are not allowed inside VIN, so I use this regular expression: ^[0-9A-Z-[IOQ]]{17}$ Now if I check a string like 1G1FP22PXS2100001 with RegularExpressionValidator it f...

disabling the Validation in struts2 and use my own customized validation

I'm developing web project in struts2 and I want validation in my own customized validation by disabling the struts2 validation, because if one field is being sent back it will check all fields but I want to check only at the time of submit. ...

Clicking twice to activate? javascript onclick issue

Hi! I'm having an issue with a project I am working on at the moment that is making use of the Validation plugin for jQuery, when the validation error appears I am dynamically applying an anchor tag to it with an onclick. And its this onclick thats the problem... The first time the validation error appears I have to click the link twic...

Using IDataErrorInfo in M-V-VM

If my domain objects implement IDataErrorInfo, and I am using M-V-VM, how do I propagate errors through the ViewModel into the View? If i was binding directly to the model, I would set the "ValidateOnExceptons" and "ValidateOnErrors" properties to true on my binding. But my ViewModel doesn't implement IDataErrorInfo. Only my model. What ...

Event on validation - WPF

I'm looking at developing a simple validation framework for WPF (the IDataErrorInfo method doesn't provide enough info for my needs), and am wondering if there is a way to be notified when a Property is going to validate? Please note that I need to know any time it is going to attempt validation rather than only when there is an error (s...

How to trim string in ClientValidationFunction

I am writing a client-side validation function for CustomValidator and I need to check length of entered string. But before, to counteract cheaters a little, I want to remove all leading and trailing spaces from the string. What is the easiest way to do it in this scenario? Thank you! ...

How do you validate an object's internal state?

I'm interested in hearing what technique(s) you're using to validate the internal state of an object during an operation that, from it's own point of view, only can fail because of bad internal state or invariant breach. My primary focus is on C++, since in C# the official and prevalent way is to throw an exception, and in C++ there's n...

Advanced Search Form Validation in asp.net

I'm looking to make validation for a page in which one or more fields have a value in them. I have an advanced search form in asp.net and I'm trying to pop up an error and not post back if all the fields are empty. I've looked into required fields validators but I'm not sure how to make them work together in a AND type fashion instead ...

Asp.net MVC Validating Dynamic Form

I'm building an ASP.NET MVC application with a form that needs validation. The majority of the form is static, but part of the form is dynamic. I need to enable the user to enter n string/date combinations. The string/date combos need to be validated server side, and I need to give feedback to the user preferably directly beside the ...

How do I create a custom validator in VAB that tests two properties at once?

Hi In my database, I have a composite unique key constraint (CustomerId, Name) on a entity. I want to test if the unique constraint is upheld before submitting changes to the database. The user can customize the Name attribute on the entity, so I would like to make a custom validator that validates the name property, but while doing it,...

How can I validate both for integers and in a range in a ColdFusion form?

In a CF8 form, I'm using a tag such as the following: <cfinput type = "Text" name = "Num" value = "0" validate = "range,integer" range = "0,1000" validateAt="onBlur,onSubmit" required = "yes" message = "Invalid Value" > When the field loses focus (onBlur), the input is validated for only the fi...

Zend_Form: how to check 2 fields are identical

I have created a form to add a user to a database and make user available for login. Now I have two password fields (the second is for validation of the first). How can I add a validator for this kind of validation to zend_form? This is my code for the two password fields: $password = new Zend_Form_Element_Password('password', array(...

How should I validate and manage a login namespace?

This is silly, but I haven't found this information. If you have names of concepts and suitable references, just let me know. I'd like to understand how should I validate a given named id for a generic entity, like, say, an email login, just like Yahoo, Google and Microsoft do. I mean... If you do have an user named foo, trying to crea...

How can I set globals to JSLint to ignore for a whole set of files?

I'd like to run JSLint4Java as part of my build process. I have about 1000 JS files in a library, and don't really want to add a /*globals foo, bar, baz */ header to each of them -- especially since many of them are from an external library (Dojo). If I don't add the header, though, JSLint complains about the same five globals on ne...

How do you approach intermittent bugs?

Scenario You've got several bug reports all showing the same problem. They're all cryptic with similar tales of how the problem occurred. You follow the steps but it doesn't reliably reproduce the problem. After some investigation and web searching, you suspect what might be going on and you are pretty sure you can fix it. Problem Unf...

jQuery validate plugin clearing file input value in IE

Hi! Im currently using this jQuery validate plugin and having an issue in IE where its removing the value of file input fields whilst validating the rest of the form. This seems to me like an onfocus issue, I select a file to upload, click on another input field and it clears the value - this only happens on the file input fields aswel...