validation

How to check for a length of 5 or 9 with hibernate validator?

I can validate the length of a String with an annotation like: @Length(max = 255) But what if I want to verifiy that the length is either 5 or 9? Can this be done with an annotation? ...

Validating data in Django ModelForm

And i have a simple modelform for Package from models import Package from django import forms class PackageForm(forms.ModelForm): class Meta: model= Package fields= ['name', 'version', 'url', 'description', 'arch', 'dependancies', 'conflicts', 'file'] How can i ask the modelform to check, within validation, if the file extens...

problem with change asp page couse requaired validator

Helo, on one of my asp.net page i have few textbox's and required validator attach to them. Everything is ok with validate, but when i want to change page to another required validator don't allowed it cause i don't fill in a textbox :/ How to allowed change page without fill a validate textbox? I must create a condition in "exit page"...

validating numerical user input

I am creating a simple CLI calculator tool as an exercise. I need to make sure n1 and n2 are numeric in order for the functions to work; consequently, I would like to make the program quit upon coming across a predetermined non-numeric value. Can anyone give me some direction? Additionally, if anyone can offer any general tips as to h...

Retrieving subclass type in base class?

I am attempting to use the Microsoft enterprise Validation methods to perform validation in my entities. In my base class I have the following method: public class BaseEntity { public bool IsValid() { return Validate().IsValid; } public ValidationResults Validate() { return Validation.Validate<this.GetType()>(this)...

CodeIgniter Validation Callback not being Called

Hi all, My callback function from validation rules isn’t being called. The other validation rules for that field ARE being called $rules[‘login_name’] = “required|max_length[12]|alpha_dash|callback__check_login_name”; function _check_login_name($login_name) { echo "here"; // DOESNT WORK } So in the above line, required, max_...

How can I validate a date in Python 3.x?

I would like to have the user input a date, something like: date = input('Date (m/dd/yyyy): ') and then make sure that the input is a valid date. I don't really care that much about the date format. Thanks for any input. ...

ASP.net, Ajax, JavaScript help

Hi, I need help in how to set webform control proprieties in asp.net and ajax control using javascript. I have asp page that has checkBox, TextBox, MaskedEditExtender, and RegularExpressionValidator. I set the mask for MaskedEditExtender as Mask="(999)999-9999" and I set the ValidationExpression for RegularExpressionValidato...

Country/City/state validation

I want to do the following things using PHP and jQuery https://www.careerbuilder.com/share/register.aspx?sc_cmp1=JS_LoginASPX_RegNow Steps Select a country from a dropdown list. The city dropdown list will fillup automatically with the list of cities of the selected country. If state is available for that country then state list wil...

Jquery Validation plugin and Colorbox

Does anyone know the best way to get the Jquery Validation plugin to run when submitting a form that has been loaded dynamically into a Jquery Colorbox modal window? ...

Button style not getting updated when manually updating data source

I have a dialog with two textboxes and a button. The button's IsEnabled style is set dynamically based on whether the data validation of the two textboxes succeeded. <Button Content="Finish" x:Name="btnFinish" Click="btnFinish_Click"> <Button.Style> <Style TargetType="{x:Type Button}"> <Setter Pro...

Simple JavaScript not executing?

What could be the cause of the validateDate() function not to execute when called? The purpose of validateDate() is to take a string like 01/01/2001 and call isValidDate() to determine if the date is valid. If it's not valid, then a warning message will appear. function isValidDate(month, day, year){ /* Purpose: return true i...

jQuery + Coldfusion, isNumeric not validating

This is the jQuery, both the game_id and the $(this).val() are integers /* AJAX call: save to DB input name=#game_id# value=#game_rating */ $.post("game_rating_submit.cfm", { id: game_id, rating: $(this).val() }, function(data) { alert('data: ' + data); }); This is the coldfusion part tha...

Retaining values in forms fields when validation of data fails.

I am having problems figuring out how to retain users data when the validation fails. I am somewhat new to PHP so I might be making some huge mistakes in my logic. Currently if the validation fails all the fields are wiped clean and $_Post data is also gone. Here is some code assuming the user enters an invalid email I want the Name f...

WCF Server Exception Handling in UI

I would like to be able to catch exception from the server and display an error beside a field that related to the error. I have a NTier client server application that uses WCF services and DTOs to pass data from the server to the client and back. I would be validating a domain object on the server and if it had error I would want to t...

WPF how to prevent Save on empty data entry dialog

I have a dialog with a few fields. Some of them use validation - ValidatesOnExceptions=True in my case. I have a data object with INotifyPropertyChanged that I bind to dialogs' DataContext. I also have a "Save" button. Validation works fine, but only after I edit each field. If dialog is opened and closed immediately, validation will ...

jquery remote validation

i have 3 remote validation in my form and 3 of them works with no errors in firefox console. the 3rd one is not working properly in IE. IE gives me the error "object doesnt support this property" this gives an error in IE check.php: &lt; ?php $sql="select * from people where email = '".$email."'"; $row=mysql_query($sql,$db_connection)...

How to validate ToCheckList jQuery plugin (or multiple select fields)?

Anyone ever use the toChecklist jQuery plugin? It basically turns a multi-select box into a list of checkboxes. Makes it easier for users to understand that they can choose more than one item - excellent plugin. However, I'm trying to make sure that users on my site pick at least 1 item in the list. ToChecklist has the capability of lim...

Currency validation

Hello All, Please help with me writing a JavaScript Validation for currency/money field. So please provide any regular expressions if u have :) Also, for my region, don't need any currency symbols like '$' in the field. Only decimals are to be included for validation as special chars., along with numbers. ...

control names in a custom validator .NET Client Side Validation

Hi I have a gridview with three columns of textboxes. It can have as many rows as necessary but its usually only about 5 rows. Each row needs to be validated. I want to create a client side validator that sums 2 of the columns together and compares it with the third column to check that the user has entered the data correctly. Just in...