validators

PHP Based HTML Validator

I need to find a PHP based HTML (as in WC3-Like) Validator that can look for invalid HTML or XHTML. I've searched Google a little, but was curious if anyone has used one they particularly liked. I have the HTML in a string: $html = "<html><head>.....</body></html>"; And I would like to be able to test the page, and have it return the...

Warning when validating my website with http://validator.w3.org?

I created a simple test page on my website www.xaisoft.com and it had no errors, but it came back with the following warning and I am not sure what it means. The Unicode Byte-Order Mark (BOM) in UTF-8 encoded files is known to cause problems for some text editors and older browsers. You may want to consider avoiding its use until it is ...

Automated Validator Object, Usefulness?

I am mulling over whether I should place metadata in an XML file, then creating an object that automates validation. The reasoning behind this is, adding or removing validation for user input would be a matter updating an XML file. I was curious what the opinions of others were on the usefulness of automating field validation in PHP. I...

Is there an implementation of JSR-303 (bean validation) available?

I know there are non-standard frameworks such as commons-validator, and hibernate validator. I wanted to know if someone knows an implementation of the official standard. ...

Verify a null field from a child when verifying parent object in nhibernate validator

How a can verify if a field of a child is null or empty when verifying the parent object? Example: public class Zone { [NotNullNotEmpty(Message = "Zone name is required.")] public string Name; public Foo Foo; } public class Foo { [NotNullNotEmpty(Message = "Foo bar is required.")] public string Bar; } ...

asp.net ajax button fires non-ajax validator

I have an ASP.NET webpage with several updatepanels. I have a row of buttons (inside an updatepanel) which are connected to another updatepanel by async triggers. Further down the page, outside any updatepanels, I have a filefield control with a few validators associated. The filefield works well, but when I call one of the buttons insi...

Custom Validation or Remove Validation on collection of object

We are facing a scenario..here it is: Our Customer Model has collection of Address object. The form displays 3 address for the customer for their input. However only the first address is mandatory. Now our Validation is on the Address Model, something like, "street address cannot be null". So when the form is submitted, the validatio...

How can I programmatically show the toolTip on a TextInput when a validator returns "invalid"?

I have a form with a TextInput that has a custom Validator. I call the Validator logic and handle the result programmatically. This all works fine, except for one problem. The TextInput gets highlighted when it is invalid, but the toolTip that contains the errorMsg does not display until I roll the mouse cursor over the TextInput. Is the...

Is there a vCalendar microformat validator/sanity checker?

I just put up a new calendar in the vCalendar microformat on one of my websites. However, I don't know how I can check if the format is valid and the dates are right. Apparently, I can't import it directly to Google Calendar. Is there an easy way to transform vCalendar data into a real calendar easily? ...

Adding a validator to the gridview textbox, created in edit-mode of a bound field

Hi,take a look at this sample code: (question bellow) <asp:GridView ID="GridView1" runat="server" AllowPaging="True" AllowSorting="True" DataSourceID="SqlDataSource2" AutoGenerateColumns="False" onrowupdated="GridView1_RowUpdated" DataKeyNames="Product_Id"> <Columns> <asp:ImageField DataImageUrlField="Image_N...

Stop postback on TextChanged

I have a textbox in an aspx page that has a TextChanged event attached to it. I also have a validator attached to the textbox. When the text is changed, the validate triggers but in case there is an error the textchanged event is still called. Do you know if it's possible to stop the postback on textchanged if the validator fires? <asp...

Use a RegularExpressionValidator to limit a word count?

I want to use an ASP.NET RegularExpressionValidator to limit the number of words in a text box. (The RegularExpressionValidator is my favoured solution because it will do both client and server side checks). So what would be the correct Regex to put in the RegularExpressionValidator that will count the words and enforce a word-limit? Fo...

Disable all Validator controls on a page

During the early stages of a dev cycle, it's a bit annoying to have all the validation controls enforcing their rules if we just want to move quickly from form to form. What is the simplest way to disable all the validator controls on a page? ...

Page_ClientValidate() with multiple ValidationGroups - how to show multiple summaries simultaneously?

ASP.NET 2.0. Lets say i have two Validation Groups valGrpOne and valGrpTwo; and two Validation Summaries valSummOne and valSummTwo; Reason for breaking up sections is purely aesthetic. One submit button which triggers validation on both groups. Now i want to trigger Client-Side validation, AND want BOTH validation summaries to display a...

How can I get Ajax and client side validators working with my ASP.Net 1.1 application in Firefox?

Ok, long story short - I've got an ASP.Net 1.1 website, which uses Validator controls and Ajax (ajax.dll, v5.7.22.2)... All of these elements of the site were chosen/implemented before I got here, and before anybody asks, no, it's not within our budget (timewise) to upgrade even to ASP.Net 2.0, let alone the latest and greatest of everyt...

Gridview Update Generates Full Page Postback

I have a gridview within an update panel with autogenerateeditbutton=true. Modifying the gridview works fine with partial updates until the following: 1) Any validator is triggered 2) The offending control is corrected 3) Update linkbutton is clicked At this point a full page post back is triggered instead of a partial. The partial up...

Upgrade hibernate-annotations and hibernate-validator

Hi all. Actually I'm using hibernate-annotations 3.3.1.GA (hibernate 3.2.6.ga) and hibernate-validator 3.0.0.ga but, due to validation problems, I need to upgrade the libraries to hibernate-annotations 3.4.0.GA (hibernate 3.3.2.GA) and hibernate-validator 3.1.0.GA. When I update my pom.xml file I get a lot of compilation errors. I thin...

ASP.NET: ValidationSummary doesn't display any contents

I'm trying to figure out how the heck the validation summary control of ASP.NET (3.5 I think) works. <asp:ValidationSummary ID="vldSummary" runat="server" DisplayMode="BulletList" CssClass="error" EnableClientScript="true" /> <asp:RequiredFieldValidator ID="vldSubject" ControlToValidate="txtSubject" EnableClientScript="false" Text=...

ASP.NET: Writing a custom server-side-only validator

Hi I want to write a custom validator which doesn't do anything before the user makes a post back (i.e. no JavaScript will be generated for it). The validator should make sure that there is a POST argument with the name hello. The value of that argument must be a comma-separated string of integers. The reason that I want to make this...

Spring - Best approach to provide specific error messages in a validator from a DAO?

What is the best way to implement a validator in Spring that accesses a DAO object but needs to return different error messages based on the DAO error? Should the DAO method throw different exceptions that the validator turns into proper error messages? Should the DAO return an enumeration so the validator can handle each return type s...