validation

CakePHP not showing flash() messages?

I am writing a CakePHP app but it doesn't seem to be showing flash() messages on any of the pages. I am using $this->Session->setFlash(); to set flash() messages and using $this->Session->flash() in my default template, as well as $this->Session->flash('auth') on the login and registration pages but they don't show the validation errors ...

jquery/validation plugin/object literals: selecting multiple checkboxes

Ok, I've tried to read up on this but I'm stumped. Unfortunately it's a case of me not understanding javascript properly. When processing a form with jqueries validation plugin, you send the variables to the php mailer using literal notation: submitHandler: function() { $.post("includes/mail-form.php", { age : $("#form-age-...

HTML5 Data Attributes for XHTML

Does anyone know how the HTML5 data attributes (data-*) can be implemented in XHTML without rendering the markup as invalid? Is there a custom namespacing hack that would allow this on existing HTML elements? ...

How to get jQuery validate success function to operate on a hidden input field?

Hi all! I have a form being validated by jQuery.validate. Using errorPlacement option I have a custom set of functions for real-time error validation. Using success option I have a custom set of functions to get rid of and replace error messages. All works great except my validation on hidden fields only works on submit. With the su...

Validation for a unique property

Does anyone know how to do validation for a unique property or can point me to an example? Say I have a grid of movies and I do an edit or an insert. If I set the textbox 'Title' to be 'A really cool movie'. How would I do the validation to ensure the database doesn't already contain a movie by this title? Would I use a CustomValidator?...

Ajax validation

how to use Ajax validation on-submit event using prototype in rails application ...

RegEx To Match "whole word" returns exception

I am trying to validate via RegEx as follows... If Regex.IsMatch(Output, "\b" & "Serial)" & "\b") Then 'do something end if but i get this Argument exception parsing "\bSerial)\b" - Too many )'s. I do understand the error, but how should i modify the RegEx expression? UPDATE. The word "Serial)" is generated dynamically. That means...

ASP.NET MVC 2 server-side validation for ajax form

Hi all! I've faced the following problem. I'm developing a form for the site and this form should have validation. I wanna to use native ASP.NET MVC 2 validation functionality but get stubborn with it. I have a form that is loaded via $.get and displayed using jQuery UI modal dialog. All examples I found explains how to use MVC validati...

Converting an empty string to a date, and then back.

I'm trying to do some validation testing in VB.NET. If Entity.WeekEndDate.ToString = String.Empty Then ErrorList.Add(New cValidationError("id", "Incorrect Week End Date")) Where WeekEndDate is of type Date. When I originally build the object, how can I insert a value into WeekEndDate that will generate an empty string(ie....

Making a custom validator with regex..not triggering yet

Hey guys, I thought this would be fairly straightforward, but it's not it seems..maybe I'm just writing the syntax wrong.. In my model I'm checking for certain key words before_validation :deal_validation def deal_validation if self.description.match /(exp\s|expire|ex\s|print|mention|\/)/ errors.add(:description, "Now just a se...

extjs show validation when switching tabs

HI, I hope somebody can help me here with the extjs framework. The problem I am having is that the field validation is not being rendered for the tabs that are not visibele on initialisation off the panel. It only starts working when clicking in the textfields. What I need is something to force the validation cue's for the fields on a...

Set value to Symfony custom select_month_tag item

I am using the select_month_tag and select_day_tag in a new Symfony 1.0 project (I know, out of date, but it's what we're using). In any case, when using the tag I know I can set the default first item in the select object to a custom item by using 'include_custom'=>'My Custom Value'. However, by default, Symfony does not give this fir...

Date validation in Cake

How can I get the built-in date formatting working in my Cake app? Maybe I am making some simple mistake. I'm focused on the model code right now, I think this is what I am screwing up. On the page it looks like it's working, showing three select widgets with months, days, years in that order. However, when I submit the form I'm getting...

How to add data validation to Silverlight 4 master-detail MVVM bound form?

Hi all, I have a Silverlight 4 application using a master/detail type UI arrangement. There is a Silverlight 4 datagrid control bound to an ObservableCollection<T> property of a custom ViewModel class I have created. Below the grid is a detail section that shows the individual detail information for each row of the grid. Each of the ...

WPF DataBinding Validation being ignored

I (believe) I'm wiring up DataBinding Validation in a textbook manner, but it just isn't working - at all. In the debugger, the Validate(object value, CultureInfo cultureInfo) method is never called. What gives? Also, for bonus points, any pointers on debugging WPF would be awesome. I'm posting my XAML and the class in question <Use...

Trouble with email validation using jQuery validation in WebKit

Hi, I'm running into a strange issue in WebKit browsers, where the "email" field on my form won't trigger validation by the jQuery validation plugin (using the built-in email method). Works in FF and IE, but Safari and Chrome don't seem to like it. I've put together a sample page here with just the form and scripts for debugging: htt...

Apache Common UrlValidator does not support unicode. alernative is avaliable?

i try to url validation. but UrlValidator is does not support unicode. here is code public static boolean isValidHttpUrl(String url) { String[] schemes = {"http", "https"}; UrlValidator urlValidator = new UrlValidator(schemes); if (urlValidator.isValid(url)) { System.out.println("url is valid"); return true; ...

How to hide Label in asp.net

i m working on simple asp.net and in that i am using validators. my situation is like that i have used reaquired field validator its working fine. and after that if i ented data and fired insert query then data is inserted and sucessful message is displyed on the lable. but agin if i clik on submit button with empty fields then validator...

Validation Attributes MVC 2 - checking one of two values

Hi guys/gals, Could someone help me with this issue. I'm trying to figure out how to check two values on a form, one of the two items has to be filled in. How do I do a check to ensure one or both of the items have been entered? I'm using viewmodels in ASP.NET MVC 2. Here's a little snip of code: The view: Email: <%=Html.TextBoxFor...

Can I count on the order of field validation in a Django form?

I have a Django form with a username and email field. I want to check the email isn't already in use by a user: def clean_email(self): email = self.cleaned_data["email"] if User.objects.filter(email=email).count() != 0: raise forms.ValidationError(_("Email not available.")) return email This works, but raises some...