form-validation

Prohibit ampersand in Rails form

NOT a Rails 3 issue In a Contact model I have a company_name attribute. For reasons that don't matter to this question, I want to prohibit an ampersand character. We have a lot of clients with ampersands in their company name, and users forget they aren't allowed to use this character. This isn't an html sanitize issue. I don't care ab...

jQuery Form Validation / Change validation type based on other form value...

We have a form that has a text input box it. The data entered into this field generally has no validation (other than being required), but we want it to validate to date if another form equals a certain value. Think about setting up password hints... You choose a hint type, say your dogs name which has no real validation, or you choose...

jQuery validation plugin: accept only alphabetical characters?

I'd like to use jQuery's validation plugin to validate a field that only accepts alphabetical characters, but there doesn't seem to be a defined rule for it. I've searched google but I've found nothing useful. Any ideas? Appreciate your help. ...

ui.datepicker.js form validation (solved)

Hi, I'm using ui.datepicker.js and I want to validate the date field to make sure the user select a date. I have tried function allow_submit() { var f = document.all.frm; if (f.date.value == "") { jAlert("Please select a date"); return false; } //if return true; } and also have try if (f.date.value == "0000-00...

Django - partially validating form

I'm new to Django, trying to process some forms. I have this form for entering information (creating a new ad) in one template: class Ad(models.Model): ... category = models.CharField("Category",max_length=30, choices=CATEGORIES) sub_category = models.CharField("Subcategory",max_length=4, choices=SUBCATEGORIES) location...

How do I clear MVC client side validation errors when a cancel button is clicked when a user has invalidated a form?

I have a partial view that is rendered within a main view. The partial view takes advantage of System.ComponentModel.DataAnnotations and Html.EnableClientValidation(). A link is clicked, and div containing the partial view is displayed within a JQuery.Dialog(). I then click the save button without entering any text in my validated inp...

How to bypass onSubmit Form validation in ASPX page

Hi, i have a form on a particular ASPX page that has custom js validation. Also on this form is a navigation menu in the header. The navigation menu items are built programatically and are initiated by __doPostBack calls which obviously submits the form. The problem i am having is that the form itself has code something like the follow...

[IceFaces] Why are validators of unchanged components called?

I have a IceFaces-form and several input fields. Let's say I have this: <ice:selectOneMenu id="accountMenu" value="#{accountController.account.aId}" validator="#{accountController.validateAccount}"> <f:selectItems id="accountItems" value="#{accountController.accountItems}" /> </ice:selectOneMenu> and this: <i...

client side validation in ascx files (user controls) for asp.net mvc

hi, I have a logOn forn in ascx files and I render it as partial. How I can add a clinet side validation to this form, have any idea ? My below code does not work <%= Html.ValidationSummary(true, "Giriş başarısız oldu. Lütfen hataları düzeltip tekrar deneyin.") %> <% Html.EnableClientValidation(); %> <% using (Html.BeginForm...

ASP.NET MVC 2 Client Side Validation doesn't work as advertised in VS2010

In VS2010 and ASP.NET MVC 2, it seems that client-side validation (JQuery Futures or the stock option) doesn't quite work as advertised. I'm noticing that "tabbing off" a validated element will not invoke the client-side validation as promised. For a required field, you have to tab into the element, enter something, then remove it comp...

Rails: how to require at least one field not to be blank

Hi I know I can require a field by adding validates_presence_of :field to the model. However, how do I require at least one field to be mandatory, while not requiring any particular field? thanks in advance -- Deb ...

jQuery Validation Plugin - Enable 'Eager' Validation only after and Invalid Submit

By default, if a user enters a value in a field, the 'eager' validation kicks in. Is there any way to disable 'eager' validation before submit and then enable it after an invalid submit has happened? I've used $.validator.setDefaults() to initially set the onkeyup and onfocusout properties to false. In the invalidHandler method I rerun...

Should the PHP files that do processing/validation of data called by AJAX be put in 'include' folder and made inaccessible to the user?

My Question is suppose I have a form which needs validation through AJAX. The AJAX is sending data to to a file called do_ajax_validation.php. Now should I put this file in 'include' folder and name it do_ajax_validation.inc.php and bar it from direct access of the user or should I put it in the directory in which the original form resid...

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

jquery validation stops page submit when non required field is empty

I'm using jquery to validate an asp.net form (content within a master page). The required fields validation all works great, but I have a field that is not required, but if it does have text then it needs to be in the proper format. Jquery validates incorrect text just fine, but when the text is empty it stops the form from submitting (n...

How to display unique success messages on jquery form validation

Hi guys, hope you can help me on this one, I'm currently using this: jQuery plugin:validation (Homepage) I've been reading related questions here, but this one is the closest get. httx://stackoverflow.com/questions/1863448/jquery-validation-on-success from the plugin's documentation httx://docs.jquery.com/Plugins/Validation/validate#t...

General error messages for validation rules in Kohana, regardless the field name

I'm using Kohana validation library and I want to set up my own user friendly error messages. The problem is that I generate the form dynamically, so field names are not know during development. Can a set up error messages for the different validation rules (required, digit, ...) regardless the field name? How? Note: I'm using Kohana v...

Displaying error messages in a div tag with GeekTantra Live Form Validation

Hi, I'm using Geek Tantra's Live Form Validation (http://www.geektantra.com/2009/09/jquery-live-form-validation-version-1-1/) which works really well. However, when it validates the fields it displays the error messages next to the field. Does anyone know how I can make the error messages appear in a Div tag across the top of the page...

Display both summary and individual error messages using jquery validation plugin

Hi, I'm just wondering how can I display both individual error messages and summary for the jquery plugin, I actually found a similar question but it just reference some hooks I can use, but I'm not sure where to start, I got the displaying individual error messages part, but I need to display the summary in an alert box on submit, plu...

Validate a single property with the Fluent Validation Library for .Net

Can you validate just a single property with the Fluent Validation Library, and if so how? I thought this discussion thread from January of 2009 showed me how to do it via the following syntax: validator.Validate(new Person(), x => x.Surname); Unfortunately it doesn't appear this works in the current version of the library. One other ...