validation

ASP.NET MVC Validation Framework when posting via jquery $.ajax?

Hello, There is a plenty of very good post and explanations how to implement validation with ASP.NET MVC, and I prefer one of these: xVal Validation with Service layer Data Annotation attributes However, I really like to call ActionMethods via jquery $.ajax method. One of the reasons why I want to use $.ajax is because there will be...

capture which button was clicked to cause the validation

Is it possible to capture what button was clicked in javascript? I have validation set up but i only want it to validate when a button is clicked and by no other means. PLEASE NOTE THAT I HAVE 3 TEXTBOXES JUST LIKE THE BELOW. IT'S FOR A PHONE NUMBER ENTRY BROKEN UP INTO 3 TEXT BOXES. What i would like to do is put and '&&' condition i...

Which characters make a url invalid?

I am writting bbcode for my own forum (based on php); how to find out if it is an invalid url provided in the the [url] tag? Which characters make a url invalid? ...

How to get the HTML's input element of "file" type to only accept pdf files?

is there any way that html element file <input name="file1" type="file" style="width:300px"> only accept PDF files and when we browse its only show PDF files... Thanks ...

How to validate XML using SAX?

How do the SAX API-s validate XML against a schema/DTD? My understanding is the SAX API-s read an XML doc chuck by chunk and do not store the previously read chunks in memory. So I'm not clear how the API could validate the doc without keeping it all in memory. ?? ...

Valid XML, Valid schema. Where have I gone wrong?

Once upon a time I had a valid doctype and valid XML. I put the former on top of the latter, cntrl-s'd and behold: all was as all should be. Nowadays I have a valid schema (custom built for my still valid XML). I tried my same tried and true approach - but alas, no success. I get different errors with each different validator I use, and...

Which validation library for ASP.NET MVC?

Hi, I'm trying to decide what validation approach to take for a new ASP.NET MVC project. (And wow there are plenty of options!) The project uses NHibernate, so the first thing I considered was the NHibernate Validator (Because of tight integration with NHibernate). However, as far as I can see there are only a couple of benefits to th...

How to use the livevalidation javascript library custom.validate function ?

Heya Folks, I am very new to all of this so please bear with me! I have mangaged to create a form with livevalidation checking of fields, and also with an ajax/json check to see if a usename is valid. I seem to get along fine with standard live validation. Here is a demo of what I have at the moment: link text The method to give a r...

How do I use the livevalidation javascript library custom.validation function ?

(note: my original question was not linked to my openid - I am reposting here to be able to edit/update/respond accordingly - if anyone with access could remove the original question: /questions/1554916/how-to-use-the-livevalidation-javascript-library-custom-validate-function that woudl be great !!) Heya Folks, I am very new to all of ...

AutoCompleteExtender OnClientItemSelected raised after validation

Hi, I have an AutoCompleteExtender which is working, the OnClientItemSelected event is raised. Now, I added a validator that validates my control (the AutoCompleteExtender is a part of that control). My problem is that the validator is called before the OnClientItemSelected event is raised. Therefore the validator returns an invalid sta...

Escaping ampersands inputted by users through text fields?

Like almost all apps today, I have users who enter various information through standard text inputs. My app is running on Rails. It's a no-brainer to escape ampersands that I include as part of the site copy, etc. But how do I escape an ampersand that is dynamically inputted by a user? Currently, it's totally breaking my frontend...

ASP.NET MVC + modelstate and partial view

I have a partial view called LogOn where i basically copied the logon inputs into a control. I am using Html.RenderPartial to place the control in my Index.Html inside of an Ajax.BeginForm <div id="login_ajaxtarget"> <% using (Ajax.BeginForm("Logon", "Account", new AjaxOptions { UpdateTargetId = "login_ajaxtarget", HttpMethod = "Post...

Rails: Modify Validation error reporting?

The standard Rails validation wraps my error-filled fields in a div of class fieldWithErrors. How can I change it so that the erroneous element's parent gets assigned that class instead of having a new div created on the page? EDIT: Per this website, this wraps errors in spans instead of divs, which helps my formatting a little, but I...

ASP.NET MVC: Is Data Annotation Validation Enough?

I'm using the Data Annotation validation extensively in ASP.NET MVC 2. This new feature has been a huge time saver, as I'm now able to define both client-side validation and server-side validation in one place. However, while I was doing some detailed testing, I realized that it's quite easy for someone to bypass the server-side valida...

regular expression in asp.net

in my application i have a text box in that '123456789v' first 9 charecter must be digits after that any character or a particular character how can i write please help me. thank u ...

css validation error moz binding?

Hi I'm a photoshop designer. I have some knowledge of css? Does anyone know what this validation error means? Am I missing something in the css? 38 marquee Property -moz-binding doesn’t exist : none URI : http://etcetc.co.uk /css/page.css 1085 input.postcode Lexical error at line 1081, column 2. Encountered: ”” (0), after : ”” } #si...

NHibernate Validator - passing resource manager and key.

Hi, According to the NHibernate Validator documentation here: http://nhforge.org/wikis/validator/nhibernate-validator-1-0-0-documentation.aspx I should be able to pass my resource manager so I can use that for validation error messages. See: Alternatively you can provide a ResourceManager while checking programmatically the valida...

CakePHP - Manipulating data-Attribute in validation process

Hi! I am trying to manipulate the $this->data attribute while performing an advanced validation method. The data seems to be changing, but when it comes to saving, the changes don't apply. My question: Am I able do edit $this->data while performing a validation method? Best regards, Benedikt ...

Triggering data validation in WPF

I have a problem in WPF with validation. I have a user control which has few textboxes, which are binding to datamodel. The validation is implemented with IDataErrorInfo. I want the validation to be triggered only when the user press the button "Submit data", so I used UpdateSourceTrigger="Explicit" with the binding of all those text...

PHP: How to validate a phone number if well formed?

Using PHP, how can I verify if a phone # is well formed? It seems easiest to simply strip all non-numeric data, leaving only the numbers. Then to check if 10 digits exist. Is this the best and easiest way? ...