validation

Simplest way to perform data validation for fields on Windows Forms

試著忘記壹切 提交于 2021-02-07 13:42:00
问题 I have a windows form project in which I want to force the user to enter values in certain fields before he presses the calculate button at the bottom. The fields include three pairs of radio buttons , five text boxes and one combo box . So basically all these fields need to contain a value in order to perform the calculations. Additionally, the text boxes should contain numbers - any double values. Moreover, I want to set a maximum value set for most of these text boxes which the user cannot

Simplest way to perform data validation for fields on Windows Forms

青春壹個敷衍的年華 提交于 2021-02-07 13:41:37
问题 I have a windows form project in which I want to force the user to enter values in certain fields before he presses the calculate button at the bottom. The fields include three pairs of radio buttons , five text boxes and one combo box . So basically all these fields need to contain a value in order to perform the calculations. Additionally, the text boxes should contain numbers - any double values. Moreover, I want to set a maximum value set for most of these text boxes which the user cannot

Simplest way to perform data validation for fields on Windows Forms

℡╲_俬逩灬. 提交于 2021-02-07 13:41:24
问题 I have a windows form project in which I want to force the user to enter values in certain fields before he presses the calculate button at the bottom. The fields include three pairs of radio buttons , five text boxes and one combo box . So basically all these fields need to contain a value in order to perform the calculations. Additionally, the text boxes should contain numbers - any double values. Moreover, I want to set a maximum value set for most of these text boxes which the user cannot

min max price range validation not working with jquery.validate.js

本秂侑毒 提交于 2021-02-07 11:56:13
问题 form validation i'm using https://jqueryvalidation.org. I have implemented custom validation rules through depends property. following are validation error rules: if both price box is not selected error won't show. if one price box (one out of both) selected ,validation error will show that user needs to select both. if both are selected, then max price value must be greater than min price . please find below my code: in my code every condition is satisfying but the last rule means max price

ASP.NET CompareValidator issue

笑着哭i 提交于 2021-02-07 11:18:20
问题 I've got a web form with Password and Confirm Password text boxes. I've got a RegularExpressionValidator attached to the first one and CompareValidator to the second one. Now the problem is when i have something in the Password field and nothing in Confirm Password field it does not display an error that fields don't match. As soon as i put something in the Confirm Password field it shows the error. I also want to allow to leave both fields blank. I'm using .NET 2.0 What might it be? 回答1:

How to return false when chaining methods

断了今生、忘了曾经 提交于 2021-02-07 08:16:24
问题 I have a validation class which uses method chaining. I would like to be able to do single checks with TRUE/FALSE like this: if ($obj->checkSomething()) {} But also chain methods like this: if ($obj->checkSomething()->checkSomethingElse()) {} The problem however is that if one method returns FALSE , it will not send back an object and thus breaks the method chaining which ends with this error: Fatal error: Call to a member function checkSomething() on a non-object in ... Do I have to pick

Rails: How to add an empty 'required' attribute to a radio_button_tag

不打扰是莪最后的温柔 提交于 2021-02-07 07:03:09
问题 I'm trying to use a radio_button_tag to generate a radio-button tag like: <input type="radio" ... required> in order to add form validation (I'm using Foundation and trying to make use of the Abide library). The closest I can get is: radio_button_tag 'my_radio', ... , required: '' # => <input type="radio" ... required="required"> This seems to be good enough for Abide to work, but is there a way I can get what I want out of the Rails helper? I've tried required: true in place of required: ''

Validation in ASP.NET Web Pages (Razor) deprecated?

孤街浪徒 提交于 2021-02-07 06:46:05
问题 I'm trying to use Validation in razor, but when I try to use the line Validation.RequireFields("firstName", "lastName", "dateOfBirth"); visual studio tells me: 'System.Web.Helpers.Validation' is obsolete: '"Use System.Web.HttpRequest.Unvalidated instead."' and 'System.Web.Helpers.Validation' does not contain a definition for 'RequireFields' but the most up to date reference I can find is http://www.asp.net/web-pages/overview/more-resources/asp-net-web-pages-api-reference#Validation and I don

How to use System.ComponentModel.DataAnnotations in WPF or Winforms application

你。 提交于 2021-02-07 06:39:49
问题 is it possible to use System.ComponentModel.DataAnnotations and it's belong attribute(such as Required , Range ,...) in WPF or Winforms class? I want put my validation to attributs. thanks EDIT 1: I write this : public class Recipe { [Required] [CustomValidation(typeof(AWValidation), "ValidateId", ErrorMessage = "nima")] public int Name { get; set; } } private void Window_Loaded(object sender, RoutedEventArgs e) { var recipe = new Recipe(); recipe.Name = 3; var context = new ValidationContext

Generating a error code per property in Hibernate Validator

本秂侑毒 提交于 2021-02-07 05:53:29
问题 I am looking at using Hibernate Validator for a requirement of mine. I want to validate a JavaBean where properties may have multiple validation checks. For example: class MyValidationBean { @NotNull @Length( min = 5, max = 10 ) private String myProperty; } But if this property fails validation I want a specific error code to be associated with the ConstraintViolation, regardless of whether it failed because of @Required or @Length, although I would like to preserve the error message. class