validation

XSD validation

Can anybody help me to build an XSD file to validate XMLs like these: [test] [a/] [b/] [a/] [b/] [/test] [test] [a/] [a/] [b/] [/test] Basically, I can have any number of and/ or nodes, without any other rule (can't use ). Thanks. ...

AdornerDecorator and tab stop issues

Hi, I am using IDataErrorInfo to validate and indicate errors in my text boxes. I am finding I have to tab once for the text box and once for the adornerdecorator. I have an error template: <ControlTemplate x:Key="ErrorTemplate"> <StackPanel KeyboardNavigation.IsTabStop="False" > <Border KeyboardNavigation.IsTabStop="F...

How to send data after form has been validated using jQuery?

I have a simple email address sign up form as follows: <form action="" id="newsletterform" method="get"> <input type="text" name="email" class="required email" id="textnewsletter" /> <input type="submit" id="signup" /> </form> Here's what I want to be able to do: Validate the form to look for an empty string or a incorr...

Specifying attribute values as CDATA

Can one specify XML attribute values as CDATA ? If yes - what would be the schema for the same. If not - why is this limitation not addressed in XML ? ...

Web User Controls and Validation

Hi, I have an ASP.Net web user control that contains a TextBox and a calendar from the Ajax Control Toolkit. When I include this user control on my page I would like it to participate in input validation (there is a required filed validator set on the TextBox inside the UC), ie. when the page is validated the content of the UC should a...

Proper use of HTTP status codes in a "validation" server

Among the data my application sends to a third-party SOA server are complex XMLs. The server owner does provide the XML schemas (.xsd) and, since the server rejects invalid XMLs with a meaningless message, I need to validate them locally before sending. I could use a stand-alone XML schema validator but they are slow, mainly because of ...

How do I remove jQuery validation from a form?

I'm using the jQuery validation plugin to validate a form, and I'd like to remove the validation and submit the form if a certain link is clicked. I am submitting form with javascript like jQuery('form#listing').submit(), so I must remove the validation rules/function with javascript. The problem is that I can't figure out how to do th...

How do I use an ASP.net asp:RangeValidator to validate a date properly?

Here's my code: <asp:TemplateField HeaderText="* License Setup Date"> <EditItemTemplate> <asp:RequiredFieldValidator ID="LicenseSetupDateRequired" ErrorMessage="License Setup Date can't be blank." ValidationGroup="EditClientDetails" ControlToValidate="BeginDate" Text="*!" ...

Simple ASP form validation - swapped?

I am trying to do some very simple form validation checking for null or '' (empty) using a conditional, but when I submit my form with ALL BLANK FIELDS, it does the latter section of my code. And when I fill out all of my fields it does that other part. So when they are blank, tell the user, which is the first section of the conditional...

Title (in ASP.NET @ Page directive) not rendering in web page

I was intending on use the Title attribute in the @Page directive to customise each pages title, but it simply doesn't appear to do anything. The site uses master pages - I don't know if that is a consideration. Master Page snippet: <%@ Master Language="VB" CodeFile="brightnorth.master.vb" Inherits="brightnorth" %> <!DOCTYPE html PUBL...

ASP.NET Viewstate validation - ASP.NET 1.1 vs. ASP.NET 3.5

Hi all, we're in the process of migrating our web app from ASP.NET 1.1 to ASP.NET 3.5. Our app runs on multiple servers through DNS round robin, so every browser request may end up on a different server. We do have a in our web.config to prevent validation errors. However, our plan was to migrate one server at a time. Now it looks lik...

SQL Server data/input validation

I am considering adding validation on some insert and update statements for MS SQL Server 2005. I want to be able to check the values inserted before it is written into the table - in this particular case, it is an integer field where the data must conform to a rule. So a simple schema could be: ([id] [int] identity(1,1), [name] [nvarch...

How to check if MySQL query is valid without executing it?

I'm making a simple tool that will get a string of MySQL commands and run it on several DB servers sequentially. I trust the users to be sensible, but mistakes happen. I'm wondering: Is there a way to validate, at runtime, (relatively simple) MySQL queries to see if they're syntactically correct? In other words, SELECT * FROM x; or...

Better way to check variable for null or empty string?

Since PHP is a dynamic language what's the best way of checking to see if a provided field is empty? I want to ensure that: null is considered an empty string a white space only string is considered empty that "0" is not considered empty This is what I've got so far: $question = trim($_POST['question']); if ("" === "$question") ...

How do I check if the required fields in an html form are filled?

I've got a submission page in php with an html form that points back to the same page. I'd like to be able to check if the required fields in the form aren't filled so I can inform the user. I'd like to know how to do that with php and javascript each. However, I imagine this is a common issue so any other answers are welcome. ...

Validating Kana Input

I am working on an application that allows users to input Japanese language characters. I am trying to come up with a way to determine whether the user's input is a Japanese kana (hiragana, katakana, or kanji). There are certain fields in the application where entering Latin text would be inappropriate and I need a way to limit certain ...

Java Validation Frameworks

I once came across a validation framework for java, where you wrote one method that protected the integrity of the data-type and any CRUD operations on that data-type automatically called this method. Does anyone know what this framework is? ...

How do i check to see if a delegate is valid on the iPhone

Hiya, I'm doing something like this: @protocol CallbackDelegate -(void) performCallback; @end @interface MyObject : NSObject { id<CallbackDelegate> delegate; } -(void)AsyncFuncCall; @end @property (nonatomic, assign) id<CallbackDelegate> *delegate; The code that owns MyObject sets up a delegate to recieve the callback function...

How to test SQL for validity from the command line?

Is there a good tool for ensuring that an SQL query is valid ANSI SQL, and optionally what DBMSs will fail to interpret it? I've found http://developer.mimer.com/validator but I was wondering whether there is a command line tool, preferably open source. ...

How do you handle errors from AJAX calls?

Let's say I have the following jQuery AJAX call: $.ajax({ type: "POST", url: "MyUrl", data: "val1=test", success: function(result){ // Do stuff } }); Now, when this AJAX call is made I want the server-side code to run through a few error handling checks (e.g. is the user still logged in, do they have permission...