form-validation

jQuery / javascript and nested if statements

I have a multi-lingual page where I want to display form validation error in the user's language. I use a hidden input to determine which language version the user is browsing like this: <input type="hidden" name="lang" id="lang" value="<?php echo $lang; ?>" /> The PHP side of the script works, but jQuery doesn't seem to realize which ...

Dynamically enable or disable RequiredFieldValidator based on value of DropDownList

I have an ASP.NET form with three text inputs, one each for "Work Phone", "Home Phone" and "Cell Phone". Each of these text inputs has a RequiredFieldValidator associated with it. I also have a DropDownList where the user can select the preferred phone type. I want to only require the field that is selected in the DropDownList. For exa...

validates_associated in production

Hi all. Imagine a simple model. class Service belongs_to :user validates_associated :user accepts_nested_attributes_for :user end Nothing special right? The validations on the associated User model trigger correctly in development mode. But don't do anything in production. I've added a validates_on_presence :user just like the d...

Is there a way to validates_presence_of only one time? (to skip that validation once the user's been notified)

So, I'd like for a user to see an error message if he submits a comment and the :name is blank (typical error message, don't need help with that). However, I'd then like to allow the user to skip that validation once he's been notified that "we like all comments to have a name." So, he submits the comment once, sees the notification, t...

Custom DataAnnotation attribute with datastore access in ASP.NET MVC 2

I have my application designed with Repository pattern implemented and my code prepared for optional dependency injection in future, if we need to support another datastore. I want to create a custom validation attribute for my content objects. This attribute should perform some kind of datastore lookup. For instance, I need my content ...

WPF: Validating an object at submission

I am creating a WPF app using MVVM. The app manages tagged documents, called Notes, similar to blog posts. A Note has a Title, Text and a Tags collection. I want to validate a Note at the time it is submitted for two validation rules: The Title can't be empty; and The Note must have at least one Tag. If validation fails, then the Not...

jQuery form validation, disabling until submitted

I'm using the jQuery Validation JS I have two contact forms, the main one that appears on one page only, and a quick-contact that is on all pages. How can I prevent quick-contact form to show the error messages ONLY on submit (without effecting the other form) ...

Spring 3.0 MVC client validation

I want to know what is the best way to validate a submition of an html form with Spring 3.0. The validations are simple mandatory checks, not very business oriented. I'm currently using spring-modules-validator + commons-validator, but it's maven dep. is with Spring 2.0 , not 3.0. I'm not using annotations. ...

.NET - getting form field key/value pairs?

Hi there, I've got a form with textboxes and I want to run some server side validation code on the values after the form is submitted. I was planning to grab all the textbox controls on the page and adding them to a list, then running a for each loop that says for each control in the list query the database where fieldValidation.Name = C...

Rails + facebox + authlogic - how?

Hello, on my web site I want to have login/registration form in modal window done using facebox (jQuery plugin). What is better: Create view with one method and template that has form and refer facebox to this view. Create static HTML file in public directory and refer facebox to this static page. What I want to achieve is: Easy v...

How to use the validation rules on both client-side and server-side?

I'm using jQuery validation system for client-side validation. The backend works with django. jQuery use an interesting set of rules in JSON format. Does exists something to use the same rules on django side or I need to code it myself? ...

Validating existing JavaScript code (for more than checking entry). Example: Email and Particular Characters etc.

Hi, I'm wondering if someone can help me. I have recently used this tutorial: http://net.tutsplus.com/tutorials/php/create-a-signup-form-with-email-confirmation/ to develop a more complex sign up form for a competition for a client. Basically, the way the validation has been done is different to many other validation methods I've used ...

Spring MVC: Where to place validation and how to validation entity references.

Let's say I have the following command bean for creating a user: public class CreateUserCommand { private String userName; private String email; private Integer occupationId; pirvate Integer countryId; } occupationId and countryId are drop down selected values on the form. They map to an entity in the database (Occupati...

jQuery validator and a custom rule that uses AJAX

Hi, I read your reply regarding the jQuery validator where you outline a method to check a username against a value in a database. Ive tried implementing this method but no matter what is returned from the PHP file I always get the message that the username is already taken. Here is ths custom method... $.validator.addMethod("uniqueU...

How can I use the client-side validation of a RequiredFieldValidator in combination with my custom usercontrol?

Using the ValidationProperty I've managed to connect a RequiredFieldValidator with my custom control. When I enable client script in the validator, JavaScript errors occur. Is there a way to tell the RequiredFieldValidator how it can validate my custom control in the client? ...

how to show success message for each field in codeigniter

how to show success message against each form field like we show error message for each field..when i write <?if(form_error('username')) { //show error message } else // show success message ?> it shows success message when the form is loaded without validating anything.. ...

ASP.NET MVC 2.0 Client-Side Validation HOWTO

Where can I find some good information on the new client-side validation functionality included in ASP.NET MVC v2? I'd like to find information about using the client-side validation JavaScript without using DataAnnotations, and I'd like to find out how custom validations are handled. For example, if I want to validate two fields toget...

how to validate usename and password from a text file form

I have a login form that has Username and password as inputs from user and I want to validate these login credentials from a text file. How can I do it? I know how to write data and read data..but how to read only specific data.or check whether username password combination exists or not. ...

Trouble with client side validation using Struts 2. Xml based validation rules not recognized.

Hi, This is my first post to ask a question on stack overflow and my issue is that when I don't see a client side validation error message when I don't enter any values for that field even when it is configured as required. The page is reloaded and goes to the result page and client validation fails. I am not sure what I am doing wrong. ...

how to check if the enddate is after the startdate in a zend form

I have a zend form with a start- and an endate. $form = new Zend_Form(); $form->setName($this->formName) ->setMethod('post'); $feStartdate = new Zend_Form_Element_Text('startdate'); $feEnddate = new Zend_Form_Element_Text('enddate'); $form->addElement($feStartDate) ->addElement($feEndDate) ->addElement('submit', 'submit...