input-validation

multiple validation errors showing up for single property

i'm often getting multiple errors showing up for an individual property, when I'd like them to be prioritized, as in, if Required is satisfied, check StringLength, but if Required fails, show that message only. I'm getting inconsistent behavior here, and I'm curious as to how the framework determines this priority? has anyone else ha...

ASP.Net WebForms requiredfieldvalidator not working in FireFox?

I have a WebForms app that uses a field validator on a dropdownlist. It works in IE but not FireFox. This is pretty straightforward stuff I'm doing. Here are the setups for the dropdown and validator: <asp:DropDownList ID ="dmbFileActNo" runat="server" CssClass="DROPDOWN_MEDIUM" AutoPostBack="True"></asp:DropDownList> <asp:require...

jquery input-validation (number characters and decimal places).

I have several javascript functions to validate the input data in textbox, so it will limit the user to type into the textbox a range of numbers (eg. from 0 to 500) an x amount of decimals (eg. 1 or 2 or 3 ....). I am having some issues with the javascript functions because they are three separate functions and the alerts get a bit mixe...

What is the regular expression for valdating a 'price' in a jtextfield

I want to validate a jtextfield as user inputs a price of some item. I have a perfectly working code which beeps and discard if user inputs some character that doesnt match the regular expression.(for regular expression "[0-9]+" it accepts any number of digits and beeps if a letter is given as input) But the problem is I want to valida...

minLength data validation is not working with Auth component for CakePHP

Let's say I have a user registration and I'm using the Auth component (/user/register is allowed of course). The problem is if I need to set a minLength validation rule in the model, it doesn't work since the Auth component hashes the password therefore it's always more than my minlength password and it passes even if it's blank. How d...

JSF how to temporary disable validators to save draft

I have a pretty complex form with lots of inputs and validators. For the user it takes pretty long time (even over an hour) to complete that, so they would like to be able to save the draft data, even if it violates rules like mandatory fields being not typed in. I believe this problem is common to many web applications, but can't find...

Data validation in excel cell using SpreadSheetGear.

Hey How to validate integer and float in excel using spreadsheet gear. Thanks in Advance Avinash ...

WPF Validation of clipboard Data

Hello normal validation is always related to some control, but in my case there is no control to fire validation when its content changes and to show errortemplate to the user. because the data to be validated is in the cipboard. when the user presses "PASTE" button viewmodel processes the data and finds it to be invalid. but what is th...

I'm confused in WPF Validation IDataErrorInfo vs ValidationRules!!

Hello Good People! I'm building my first WPF application and some of the validation techniques are getting me confused the more i google looking for a solution. My application connects to a web service and pulls data for manipulation.After manipulation the app calls another method for example to send the manipulated data. (for example i...

How to detect if a form input element of type file is empty

I have some code which reads a file through a form field of type file <input type="file" ... /> I want to give the user another option of providing a url to a file rather than having to upload it as many are already online. How can I detect when this field is empty on the server side. I am using Apache Commons FileUpload FileItemSt...

Page_ClientValidate() not showing up

Hi I have a strange issue. Do not know why it is happening. I have a simplemodal by jquery (http://www.ericmmartin.com/projects/simplemodal/) I have a few ASP.NET controls inside my div. Now this is what happens: I open the modal using the show modal button -> it pops-up I deliberately leave empty values and click my button, it "sho...

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 :...

A good class structure for cleaning and using input?

I want to be helpful to the users of a system, so I'll clean up the input a bit before testing if it can be used. So I have a flow like this: Input: aa12345b Clean input somehow: 12345 Test if clean input is valid Use input if valid Now I want to do this in a beautiful OO-fashion (IoC, interfaces, testable, no statics, you know). Any...

Conditional required field validation in an ASP.net ListView

I'm having a heck of a time trying to figure out how to implement validation in a ListView. The goal is to require the user to enter text in the comments TextBox, but only if the CheckBox is checked. Downside is that these controls are in the EditTemplate of a ListView. Below is a snippet of the relevant code portion of the EditTempla...

How to use Scanner to accept only valid int as input

I'm trying to make a small program more robust and I need some help with that. Scanner kb = new Scanner(System.in); int num1; int num2 = 0; System.out.print("Enter number 1: "); num1 = kb.nextInt(); while(num2<num1) { System.out.print("Enter number 2: "); num2 = kb.nextInt(); } Number 2 has to be greater than number 1 Also I want the...

How can I enter only numbers in TextBox using JavaScript without disable right click ?

I want to allow numbers only to be allowed for a textbox and I already do it onkeydown event by allow only numbers and prevent ctrl+V but I have two problems : if I make right click then paste so any char can be entered and I want a solution without disable right click by oncontextmenu="return false;" if I drag and drop any text it wil...

Adapt text validation function to consider selected text

I have this function which evaluates the contents of a textbox (or combobox or maskedtextbox) control and, in conjunction with a KeyPress event, will either allow or disallow the input. It is quite useful for dates or textboxes for which only numeric input is valid. It allows a set number of digits after a single decimal point, if spec...

How can I display CakePHP input validation errors in a different spot the default?

Let's say I have field that looks like this in the view: <li class="bigfield"> <?php echo $form->input('phone', array('placeholder' => 'Phone','label' => false,'between' => '<br />')); ?> </li> If I have a validation rule on this field and validation fails, I see the following HTML: <li class="bigfield"> <div class="input text re...

JavaScript: input validation in the keydown event

Hi, I'm attempting to do info validation against user text input in the process of keydown event. The reason that I am trying to validate in the keydown event is because I do not want to display the characters those that are considered to be illegal in the input box at the beginning. The validation I am writing is like this, function ...

Having problems passing a regular expression through to a method:

Hi I have an input on my page: onclick="return tagList.addTag(true,'/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/')" then I have some code that wants to pass through the regular expression....... //get the value from the textbox var _tagObject = document.getElementById('txt_newTag'); //validate the contents validateEmail(_tag...