validation

ASP.NET MVC2 Model Validation Fails with Non-US Date Format

I have a small MVC2 app that displays in two cultures: en-US and es-MX. One portion contains a user input for a date that is pre-populated with the current date in the Model. When using en-US, the date field is displayed as MM/dd/yyyy and can be changed using the same format without causing any validation errors. When using es-MX, the...

Setting a form field's value during validation

I read about this issue already, but I'm having trouble understanding why I can't change the value of a form's field during validation. I have a form where a user can enter a decimal value. This value has to be higher than the initial value of the item the user is changing. During clean(), the value that was entered is checked against t...

Recaptcha being triggered from masterpage control

Hey, I have a master page which contains a Login control so that the user can login/logout from any page. However, a couple of content pages require a Recaptcha control. This causes problems because when I try and log in on a page that has the Recaptcha control, the system expects me to enter the words. I'm aware of the lack of validat...

How to conditionally disable client side validation in xVal?

I am using xVal in a ASP.NET MVC project. One of the forms has two buttons and i want to disable the client side validation when one of the buttons is clicked. Is there a way to conditionally disable client side validation in xVal? ...

Multiple schema validation in Java

Hi, I am trying to do multiple schema validation in Java. I don't understand where I am doing wrong. Any help will be appreciated. abc.xsd <?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xn="project-xml-r4j_another.xsd"> <xsd:import namespace="project-xml-r4j_another.xsd"/> <xs...

JQuery validate e-mail address regex

Hi folks, not too sure about how to do this. I need/want to validate email addresses by regex using something like this: [a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+(?:[A-Z]{2}|com|org|net|edu|gov|mil|biz|info|mobi|name|aero|asia|jobs|museum) Not I need to run this in a JQ fun...

Validate DateTime in Validation Application Block

Hello All! How to validate DateTime by Validation Application Block, to not be more than DateTime.Now? thanks. ...

MVC2 Client-Side Validation for injected Ajax content

Hi, I am making an Ajax call and adding content to a form inside a MVC2 app. I need to update the Client Validation Metadata with the validation for my new content. <script type="text/javascript"> //<![CDATA[ if (!window.mvcClientValidationMetadata) { window.mvcClientValidationMetadata = []; } window.mvcClientValidationMetadata.push(...

php validation function for name that allow UTF-8 characters plus - (minus) and space

Hello everybody, Please help me with a function that validate an input string to allow: 1) UTF-8 characters (ex: şţăîâ) ; 2) space ; 3) minus symbol(-) String cannot start or end with space or minus. Thanks! ...

Getting the validation metadata for built in validators

How do you get the validation metadata for the built in validation attributes? I'm trying to implement a word count/character count on a form giving the remaining number allowed. As I am implementing the word count validation and metadata myself (adding it into AdditionalValues) I can access this fine, but having spent ages looking I ca...

Rails: validate presence of parent_id in has_many association

I have a projects resource that has many tasks. I want to ensure that every task has a project_id by adding validates_presence_of :project_id to the tasks model. However, when creating a new project with tasks, the project_id won't be available until the record saves, therefore I can't use validates_presence_of :project_id. So my que...

Disable button until text fields have been entered?

I have several uitextfields within a view and I would like to disable the uibutton until all the fields have something entered into them. What's the best way of doing this? Ideally, I'd like to do some basic validation (make sure all entries are numbers) too. EDIT Couldn't get the solutions below to quite work. Below is the version ...

Conditional Validation using JQuery Validation Plugin

I have a simple html form that I've added validation to using the JQuery Validation plugin. I have it working for single fields that require a value. I now need to extend that so that if a user answers Yes to a question they must enter something in the Details field, otherwise the Details field can be left blank. I'm using radio buttons ...

Get Image dimensions using Javascript during file upload

Hi, I have file upload UI element in which the user will upload images. Here I have to validate the height and width of the image in client side. Is it possible to find the size of the image having only the file path in JS? Note: If No, is there any other way to find the dimensions in Client side? ...

Illegal Character in File Name

Hi, During my file upload process, I found illegal character getting saved in Table. zurück.pdf, C _Word.doc were the file names. Here ü, space between C and _Word was found as ? in the Table Column. I have validate the filename in client side by replacing non-alpha numeric values by _ (underscore), but still it escapes and persist into...

Zend framework currency validation

How can I validate (a form element in this case) to ensure that the value is a currency? Have looked at Zend_Validate_Float. Needs to check that value is between 0 and 2dp. Ideally locale-aware (as ZVF is) to allow for locale specific formatting (thousands, decimal as comma/dot) Would also want to extend to allow/disallow negative val...

Using different validation rules based on user input.

I have a simple form: a combobox and a textbox. My combobox has 2 values: A and B. When value A is selected I want textbox to use a validation rule. When value B is selected there should be no validation rules applied to the textbox. I've read an article that has a solution and I'm trying to use it, but had no luck so far, and I think t...

Javascript vs ASP.NET validation, which one to choose?

Concerning validation, Are javascript and ASP.NET validation used for the same purpose? If yes, which one do you recommend? Please provide a simple explanation. Thanks ...

Is there a way to know if a Java program was started from the command line or from a jar file?

I want to either display a message in the console or a pop up, so in case a parameter is not specified, I want to know to which should I display Something like: if( !file.exists() ) { if( fromCommandLine()){ System.out.println("File doesn't exists"); }else if ( fromDoubleClickOnJar() ) { JOptionPane.showMessage(...

ASP.NET validators error message in client-side JavaScript

Hello, The error message that gets added to the validation summary when the form is invalid I need to get access to in client-side JavaScript. How do you access the actual message? My page doesn't have a ValidationSummary present, and Page_Validators[0].errormessage is *. Where is the message? Thanks. ...