validation

Best way to validate URL parameters in Spring MVC website?

I am using Spring MVC to build my web application, and I have a question about validating parameters I receive in the URL. What is the best way to detect invalid parameters and display errors to the user? Suppose I have a "View User Profile" page. The profile that is displayed is based on a user ID parameter specified in the URL. I migh...

Creating an isset if fuction using php to avoid and update if the input is empty for a MYSQL update.

Hi I am newish to php and I have created an update page for Content Management System. I have a file upload in this case a picture. I have other inputs that contain text and I can get them to populate my form and thats fine and works great because the user can see what has already been entered. But the file name for the photo can not hav...

Input validation in Winforms

In good old MFC, the DDX routines would have built in validation for form entries. For example it was possible to automatically check if the user entered a string in a text box meant for numeric input. Is there any such mechanism in Winforms? Obviously one can add handlers for the 'onChange' etc kind of events and do the processing the...

Push data back from control to source without Validating event

I have TextBox controls on a WinForm bound to a BindingSource. If I set CausesValidation = false on these controls it doesn't update data source on tableAdapter.Update() method. I know that Control.Validating event does this saving but how can I update source if CausesValidation is disabled? ...

Concise ASP.NET Validation Summary

Hi, is there any way to get the ASP.NET validation summary control to just display the HeaderText when there is a validation error? Basically what I want is for just a simple message like "Please complete all fields marked *" to appear next to the submit button. As I'm using "*" for the error message on the validators I don't want these...

How to tell whether an XML document validates against a DTD or XSD?

In Java, I can validate an XML document against an XSD schema using javax.xml.validation.Validator, or against a DTD by simply parsing the document using org.xml.sax.XMLReader. What I need though is a way of programmatically determining whether the document itself validates against a DTD (i.e. it contains a <!DOCTYPE ...> statement) or ...

How can I use CompareValidator for times without dates?

When I enter 9:00 into the Start control, and 16:00 into Finish; the code below fails validation. Does anybody know a way I can use the ASP.NET validator for times without the dates? Start <asp:TextBox ID="txtStart" runat="server" /> (hh:mm) <br /> Finish <asp:TextBox ID="txtFinish" runat="server" /> (hh:mm) <br /> <asp:CompareValidato...

Should I use MS Validation Application Block in an ASP.NET MVC app?

I know that the MS Validation Application Block can be used with ASP.NET MVC but I'm not sure if I should. It looks like it hasn't been updated since 2007 - which is probably fine - I'm just being extra cautious before adopting something new into my app that i haven't used before. Is there any reason not to - or what does it do for me t...

Phone number format and validation library

This question asking for a phone number format API in Java got me wondering why such an API doesn't seem to exist. Given the number of validation classes available under Apache Commons, I would have thought such an API would be included. My question is, does anyone know of a phone number formatting/validation library available in any l...

Handling Request Validation 'silently'

I'm trying to override the onError event handler of a web form to allow "A potentially dangerous Request.Form value was detected from the client" type errors to be handled within the form rather than ending up at the application level error handler. I found some sample code like this : protected override void OnError(EventArgs e) { ...

Validate specific input, Javascript

<form action="/cgi-bin/Lib.exe" method=POST name="checks"> <input type=checkbox name="user1" value="'$NAME'"> <input type=checkbox name="user2" value="'$NAME'"> <input type=checkbox name="user3" value="'$NAME'"> <input type="button" value="User 1" onclick="somefunction()"> For example, if I selected c...

How can I check if a single character appears in a string?

In Java is there a way to check the condition: "Does this single character appear at all in string x" without using a loop? Thank you, ...

AJAX validations in struts 2

Can we do client side validation using AJAX in struts 2 application ? If yes, then please let me know the procedure. ...

Custom date format with jQuery validation plugin

How can I specify a custom date formate to be validated with the Validation Plugin for jQuery? thanks! ...

Validating function arguments?

On a regular basis, I validate my function arguments: public static void Function(int i, string s) { Debug.Assert(i > 0); Debug.Assert(s != null); Debug.Assert(s.length > 0); } Of course the checks are "valid" in the context of the function. Is this common industry practice? What is common practice concerning function argumen...

server side validation in java web application

How we can validate the our jsp form before storing the data in database ...

action-validation.xml in struts 2

I have started a web application using struts 2. Apache tomcat 6.0 is my web server. It is clear to me that we can validate data using action-validation.xml as my login-validation.xml is – <validators> <field name="username"> <field-validator type="requiredstring"> <message>Login name is required</message> </field-validator> </field> <...

Validate all ASPX, ASCX and HTML files when building

Visual Studio will show errors in an AS?X or HTML file in the Error List window when you have that file open. However once you close the file the error(s) are removed from the Error List. Is it possible to validate all AS?X and HTML files in one action (ideally as part of building) and show all errors at once? ...

How do you do validation in ASP.NET MVC RC?

Does ASP.NET MVC provide a standard validator functionality or do you have to create your own validation manually? If the latter, is there any third party validator available that you can use on ASP.NET MVC web applications? ...

Validation in a Domain Driven Design

How do you deal with validation on complex aggregates in a domain driven design? Do you consolidate your business rules/validation logic? I understand argument validation. And I understand property validation which can be attached to the models themselves and do things like check that an email address or zipcode is valid or that a first...