validation

PHP function to validate array

Is there a function which I could give an array, which would return true if the provided function returned true for all of them? theFunction(array(1,2,3) , 'is_numeric') //true theFunction(array(1,"b",3) , 'is_numeric') //false ...

how to validate a text field using selection of a radion button in struts2

I need to validate two text fields as email and mobile number. I need to validate these based on the user selection of radio buttons. If the user selected the email option in radio button, then email text filed should be validated if he selected mobile number then need to validate mobile number text field. Since I use struts2 I have no ...

Drupal - Make a validate function for cck form

I have created different node forms for different content types, by using this function in my template: function mytheme_theme($existing, $type, $theme, $path) { return array( 'type1_form' => array( 'arguments' => array('form' => NULL), 'template' => 'type1_form' ), 'type2_form' => array( 'argument...

Using jQuery to check for regular expressions

Hi all, I know there's the jQuery validation plugin. But I don't need something that extensive. All I want to do is have jQuery check a name text box: <input type="text" name="name" id="name" /> To make sure that it has at least 2 characters AND I want jQuery to check a phone text box (identical to the name text box, name="phone" ...

Javascript validation Problem

In my employee information page, i use the validation in the information page. In that javascript regular expression, var nameRegex = /^[(a-z)(A-Z)\s ]*$/; This nameRegex match with my last and firstname. } else if(!lastname.match(nameRegex)) { For this one, special character are not allowed in last name. It restrict all the spec...

Form validation with PHP and Javascript security

I was wondering if it is really necessary to validate in both JS and PHP? I have my submit button with JS document.myform.submit()sending with PHP POST to the same page.  If a user disables JS he can not send the form anyway. So I wanted to ask about security, can someone send the variables in another way bypassing the javascript? How wo...

ASP.NET Validation styling

I'm using ASP.NET WebForms and using some validation like the following: <asp:TextBox runat="server" ID="txtUserName" CssClass="Email" /><br /> <asp:RequiredFieldValidator runat="server" ID="rfvUserName" Display="Dynamic" ControlToValidate="txtUserName" ErrorMessage="Please enter your email address" CssClass="Error" /> <asp:RegularExpr...

How to display validation error in Rails during an update operation ?

Hi, I am having a form and I am trying to save something. Whenever I hit the save button, I am running an update query in the controller. Everything works fine. I have put a validation in place for one of the text fields which takes text lengths of minimum 5. The error appears while I create the entry. However, when I try to just updat...

How to validate an LDIF?

How to validate an LDIF? Similar to XML, XMLSchema and Schematron are there any libraries to validate an LDIF with an LDAP schema? Thanks, Chenz ...

ASP.NET MVC2 Client Validation bug?

I enable client validation using the Html.EnableClientValidation method in my view. This client-side validation works great for text boxes, but I think I might have found a bug when used with dropdownboxes. If you use the following construction Html.DropDownList( name, data, "Please choose..." ) without any ViewData-item with that name ...

Implementation suggestions for creating an expression later used to evaluate the contents of a map in c++?

...

validate username, password and email with php

Hi. I am working on validating username, pass and email with php. I need to be sure I get it right so nobody can bypass the login page. This is the values: $email=$_POST['email']; $username=$_POST['uname']; $passwd=$_POST['pass']; $passwd2=$_POST['passcopy']; So far I have email validation: if(!(preg_match("/^[\.A-z0-9_\-\+]+[@][A-...

Validators inside Webcontrol doesn't trip Page.IsValid

Hi, I had a dotnet page with some input boxes and a bunch of validators on it that was working fine. However I decided to re-engineer it so that some of the functionality was parcelled up into webcontrols instead. Now in order to check validation before moving on I'm using Page.IsValid in the button click event, because the button whic...

validate.cfc Regular expression help for email

I'm using the excellent validate CFC by Ryan J. Heldt http://validation.riaforge.org/ but have a problem with the email validation RE. RFC 5322 allows the following characters ! # $ % & ' * + - / = ? ^ _ ` { | } ~ however the RE in validate.cfc rejects JohnO'[email protected] because of the apostrophe. The RE in question is in ...

ALSB: How to turn off XML validation for incoming messages?

Hello! Having an ALSB application with a link from another internal application, is it possible to turn XML validation on that link off? I'm looking to ways to improve performance, and the validation of messages from a well-tested application certainly feels like unnecessary. ...

jQuery validator access from error handler

I'm posting text and have created a remote validator. I've used it now 3 times and I want to consolidate the validator into a specific method. I'm having problems making the data ($("#Title")) and the error handler more generic ($("#editIntroOverlay > form").validate()). Is there a property of the validator object I can access like '...

What validation must a form include? Best practices

I am trying to put together a checklist things I need to keep in mind when creating forms. I know I need to filter input content. I already am filtering for errant html and scripts, escaping mysql, and limiting to data types(phone numbers are 10+ digits with training extension digits, email has to be email, strings cannot contain html ...

How to clear textboxes defined with MVC HTML helpers

I can't figure out how to do this very simple thing: My page contains a set of textboxes that a user can fill out to add an item to a list. Then the item shows up in a dropdown list. At that point, I want the "add" textboxes to be cleared. This is the behavior expected by most users, I think. The item has been added; now the textboxes ...

Validation rule for a composite unique index (non-primary)

I am sure I am not the first who has composite unique keys in tables and who wants to validate them. I do not want to invent the bicycle so I ask here first. I have several tables that have 'id' columns as primary keys and two other columns as unique composite keys. It would be nice to have a validation rule to check that the submitted e...

Are there Python statical analysis/validation tools?

Hey guys, I've never been a huge Python fan. I learned it for a course where the teacher was really into it, but his enthusiasm never quite made it to the rest of our class it seems: as soon as we had the chance, we all jumped off to C#/Java. Anyways. This wasn't a concluding experience, and what annoyed me the most in the language was...