validation

jQuery Validation: validate atleast one checkbox is selected from a list where names are different

I need to validate that atleast one check box is selected from a list of checkboxes using jQuery Validation Plugin. Since the checkboxes are part of a ASP.NET GridView Control, the names of these checkboxes will be different, which makes setting up the rules for the validation plugin complex since it expects the name for the rule. I have...

PHP: fastest way to check for invalid characters (all but a-z, A-Z, 0-9, #, -, ., $)?

I have to check the buffer input to a PHP socket server as fast as possible. To do so, I need to know if the input message $buffer contains any other character(s) than the following: a-z, A-Z, 0-9, #, -, . and $ I'm currently using the following ereg function, but wonder if there are ways to optimize the speed. Should I maybe use a diff...

Is There A Standard Way To Allow The User To Select A Text Viewer?

In my Windows desktop program, I want to be able to allow the user to select a text viewer that my program will use. By default, I'll have it set to be the program (s)he uses to view .TXT files, and I can find that easily enough from the Registry. But he may want to change to use Notepad or Wordpad or some other program (e.g. UltraEdit)...

Jquery form validation plugin, how to select dynamically generated input elements to validate?

I am using Jquery form validation plug-in to validate inputs within a form before submitting, there are some input elements which are named as "question1”, "question2", "question3",..., they are dynamically generated. So how to validate these input elements within the Jquery plugin function validate()? I need a means to select them first...

Jquery Validation Central Message Many Errors

Hi everyone, I have a form that is being valdated with the Jquery Validation Plugin. I have managed to get a centeral message "Please Recheck the form", and to have the input focus on the first error. To get this, I had to override the default message of each of the errors. I was wondering if anyone could help me figure out how I can hav...

How to call DataAnnotations in business layer (ASP.NET)?

I would like to use the DataAnnotations on my transfer objects. However how do I call them in the business layer to verify the input? Is this by some method call or reflection? I do not use ASP.NET but standard ASP.NET and would like to call the data annotations in the business layer. ...

Any point in validating SMTP addresses with a regex?

I have an app where users can send emails to other users by selecting names from a list. There's also a textbox where they can freely enter a list of email addresses to Cc. Currently, each address to Cc is validated by an extensive regular expression, which checks conformance to RFC2822. The address is then added to the System.Net.Mail.M...

How do I validate a Word 2007 File against wml.xsd with Java?

I would like to validate a given Word 2007 XML file against the Schema defined in wml.xsd. How could it be done in Java? Loading the Schema with the following line is not a problem. But it seems that I have to tweak the validation process becaus I get error messages even on valid input files (I could open and view the input file in Word ...

Axapta Validation Class

I've written a method to handle regex validation in AX2009. Problem is that it always returns false, no matter what the expression or input string. Returns no errors, just 'false' Mind taking a look? I'm probably missing something simple. This post has been updated to included the corrected method, without the error, so you can cut ...

ASP.NET MVC xVal with Strongly Typed ViewModel

I can't get xVal validation to work with strongly typed viewmodels. Every method in xVal seems to want a prefix which is not used when dealing with strongly typed viewmodels. My view contains code similar to this: <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<ContactForm>...

C#: Anything similar to the php ctype_digit function for C#?

I have a string and I want to check that it only consists of digits. I don't really want to (or need to) parse it or anything, I just want to know that it does not contain anything but digits (and no floating point separator either, just digits). PHP has this nice function called ctype_digit. Is there anything similar for C# anywhere in...

Using DataAnnotations for validation in MVVM

Hi, I've discovered the new data annotation features of SL3 and I'm using them for user input validation. I've got inputs like these: <dataInput:Label Target="{Binding ElementName=inputName}"/> <TextBox x:Name="inputName" Text="{Binding RequestDemoData.Name, Mode=TwoWay, Valid...

Validation failed but moving to next page

I have regular expression validation in a page which checks whether the entered value in the text box is a numeric, it is not numeric it gives error message says "it should be numeric" but when i click on the next button of the form .. it navigates to the next page. But it shouldn't be. How to solve this? Protected Sub btn_View1_Next_...

validation with asp.net using javascript...

i have to validate listbox for maximum of three items to select by the user... i have write code that works fine... but if i'll use the same code in customer validator in asp.net it...pop ups the msg that please select maximum of three items..but after it, the page get post back to server...that should not happen... give me solution p...

Paperclip validates_attachment_content_type for mp3 triggered when attaching mp3

Hey everyone, Struggling to workout when i add the following validtion to my Voice model using paperclip, it is being triggered when i try and upload an mp3: class Voice < ActiveRecord::Base has_attached_file :clip validates_attachment_presence :clip validates_attachment_content_type :clip, :content_type => [ 'application/mp3', ...

Validate date textbox

I'm using the following code to check if a valid date has been typed into a textbox: public bool ValidateDate(Control ctrl) { if (!string.IsNullOrEmpty(ctrl.Text)) { DateTime value; if (!DateTime.TryParse(ctrl.Text, out value)) { return false; } } return true; } private void ...

Custom validation help needed.

hi i have in my model: validate :check_product_stock def check_product_stock @thisproduct = product.id @productbeingchecked = Product.find_by_id(@thisproduct) @stocknumber = @productbeingchecked.stock_number if producto.en_stock == 0 raise "El Producto no tiene stock suficiente para completar la venta" #errors.add ...

Rails (RoR) ActiveRecord custom validation

I'm trying to extend ActiveRecord with the custom validation method validate_as_email so i could use it like this: class User < ActiveRecord::Base validates_as_email :email end I found description on how to extend ActiveRecord::Base class here: http://guides.rubyonrails.org/activerecord%5Fvalidations%5Fcallbacks.html It says you hav...

Validate data using DataAnnotations with WPF & Entity Framework?

Hello is thee any way to validate using Data Using DataAnnotations in WPF & Entity Framework? ...

Which validator should be used to implement login in Symfony?

Currently, my login form looks like this, class LoginForm extends BaseFormPropel { public function setup() { $this->setWidgets(array( 'login_id' => new sfWidgetFormInput(), 'pwd' => new sfWidgetFormInputPassword() )); $this->widgetSchema->setLabels(array( 'login_id'=>'Login Id', 'pwd'=>'Password'...