validation

Where do you perform your validation?

Hopefully you'll see the problem I'm describing in the scenario below. If it's not clear, please let me know. You've got an application that's broken into three layers, front end UI layer, could be asp.net webform, or window (used for editing Person data) middle tier business service layer, compiled into a dll (PersonServices) data a...

Need to determine if a user in ActiveDirectory is still valid/active.

I have a .NET MVC (1.0) application that is using the ActiveDirectoryMembershipProvider to authenticate users, and this is working fine as is. After a successful authentication, I am creating a custom profile in SQL for that user (AD username, email, etc). In one part of the application I am sending email alerts to users, and I am loop...

Which are the valid control characters in HTML/XHTML forms.

Hello, I'm tring to create form validation unit that, in addition to "regular" tests checks encoding as well. According to this article http://www.w3.org/International/questions/qa-forms-utf-8 the allowed characters are CR, LF and TAB in range of 0-31, the DEL=127 in not allowed. On the other hand, there are control characters in rang...

Surrounding a ValidationSummary with a box via CSS

Hi, By default Html.ValidationSummary() produces HTML like this: <span class="validation-summary-errors">There were some errors...</span> <ul class="validation-summary-errors"> <li>First Name too long</li> <li>Invalid Email Address</li> </ul> I'd like to select the entire validation summary and add a bounding box around it via ...

Check if a pdf file is valid using PdfBox by Apache

I am using PdfBox in Java to extract text from PDF files. Some of the input files provided are not valid and PDFTextStripper halts on these files. Is there a clean way to check if the provided file is indeed a valid PDF? ...

Asp.Net Modal "OK" is triggering validation... How can I stop that?

I have a pop-up modal that is displayed as soon as anyone visits a page (on page load). The modal is an agreement they must accept to continue. The problem is, when they click accept, it triggers all the client side validation, displaying all the error messages. I obviously don't want this to happen as the user hasn't even gotten a ch...

Problem validating filetypes in an ASP.NET FileUpload control with RegularExpressionValidator

code: <span>Upload Adobe Acrobat file<img src="../../Images/UI/pdf.jpg" style="height: 25; width: 20" height="25" width="20" /></span> <asp:FileUpload ID="uplPdf" runat="server" /> <asp:RegularExpressionValidator ID="valPdf" runat="server" ErrorMessage="Only PDF files are allowed!" ValidationExpression="^(([a-zA-Z]:)|(\\{2}\w+)\...

Best way to make sure username isn't a reserved word?

Let's say I'm building a web application whose user pages can be found at http://example.com/NAME. What's the best way to make sure the username doesn't conflict with a reserved word (e.g. 'about', 'contact', etc.)? I can think of two ways: Maintain a list somewhere in my code. This is great and all, but means I have another piece of c...

How do I get Client-side validation of ASP.Net page to run?

I'm trying to get client-side validation running. I've put together a very simple test - file name is aTET3.aspx: <%@ Page Language="C#" AutoEventWireup="true" CodeFile="aTET3.aspx.cs" Inherits="aTET3" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; ...

Restrict number of user account sign-ups in a period ???

I have a web app that requires a user to have an account. This user can then vote 'once' on a specific item. However, some users are signing up for lots of accounts to 'game' the system. Does anyone have any ideas how you can restrict this type of thing? Could I restrict number of signups per day per IP address? (what are problems with...

localization in text validation

I recently realized that some countries display floating point numbers with different comma/period notation. ie. we would have 12,500.34, and some countries would list it as 12.500,34 This may not be a problem with display, but what about text input? For example, I imagine that if I had a decimal type and displayed it in a label, that...

RequiredFieldValidator not firing when ControlToValidate visiblity is changed

When I change ddl.Visible=true(it gets changed on partial postback/updatepanel from another form element event)the RequiredFieldValidator will not fire? NOTE: This is not a question on how to use the RequiredFieldValidator in a normal circumstance. My form has cascading dropdowns that are all dynamically built with their visibility tog...

Validating a node move in a nested set

I am creating a Category model and using the awesome_nested_set plugin (a replacement for acts_as_nested_set) to deal with the hierarchy. With awesome_nested_set, objects are created, then saved, and then placed within the set. As well, lft, rgt and parent_id are attr_protected so they cannot be written to directly. I am running into tw...

method for creating a unique validation key/number

I'm using django for a web-magazine with subscriber-content. when a user purchases a subscription, the site will create a validation key, and send it to the user email address. The validation key would be added to a list of "valid keys" until it is used. What is the best method for creating a simple yet unique key? Can someone suggest...

Business rules - where do they go in OOP?

I have a class : Schedule. public class Schedule { private int locationNum; private int cost; private String costReason; private Date weekOfChange; private Date dayOfChange; private String changeReason; // and all those getters and setters public Schedule(int locationNum, int cost, String costReason, Date weekOfChange, Date dayOfCh...

Strange behaviour of WPF's Validation.Error and Validation.HasError

I have TextBox which should only contain a valid integer. It’s validated using a custom ValidationRule. The problem I am experiencing is that when the TextBox.Text is invalid, say “3a”, and I type another “a”, then the TextBox’s attached property Validation.HasError changes from TRUE -> FALSE -> TRUE. My software reacts whenever the Vali...

jQuery Watermarked input and validation

On a HTML page I have an inputbox that has a 'watermark' on it when it is empty. (eg: "enter text here..."). Kind of like this: http://digitalbush.com/projects/watermark-input-plugin/ - but custom written. The problem is that I can't figure out how to validate this field with the jQuery validation plugin (http://docs.jquery.com/Plugins/...

Which validating python XML api to use?

I new to xml stuff, so I have no idea which api I should use in python. Till now I used xmlproc, but I heard it is not developed any more. I have basically only one requirement: I want to validate against a dtd that I can choose in my program. I can't thrust the doctype thing. Performance does not really matter, so I would like to use ...

adding an error / removing an error in jquery.validate

Hi, I'm trying to implement a generic way of adding remote validation to xVal / jquery.validate There are only two unsolved questions left: How do I "manually" mark a form element as invalid and add an error message to it from my own javascript code? How do I remove remove the error message at a later time without removing any other...

Visual Studio 2008 custom config xsd intellisense auto complete broken!

Hi, I used to use the intellisense feature within visual studio 2003 for editing a custom .config file against my custom xsd schema. I put the schema in: Common7\Packages\schemas\xml Everything worked happily, no problem. I have just tried to do the same in VS 2008 and there is no intellisense. The schema viewer for the .config file...