validation

What's the longest possible worldwide phone number I should consider in SQL varchar(length) for phone

What's the longest possible worldwide phone number I should consider in SQL varchar(length) for phone. considerations: + for country code () for area code x + 6 numbers for Extension extension (so make it 8 {space}) spaces between groups (i.e. in American phones +x xxx xxx xxxx = 3 spaces) here is where I need your help, I want it to ...

Set focus on on ASP.NET MVC model errors

I've got a model that does some validation checking and adds the errors to ModelState: ViewData.ModelState.AddModelError("mycontrol", "message") They display fine on the view side, but is there a way to set the focus to the control that corresponds to the validation message? Right now, the page refreshes and stays at the top of the pa...

No blanks in JTextField

How can I forbid users to put blanks into a JTextField? It should not even be possible to write blanks. ...

How to use SAXParseException effectively in Java

Hi, I'm validating against XMLSchema in Java, and getting SAXParseExceptions thrown when I have non-valid content models. I'm going to be using these exceptions to highlight where the validation has failed - but the SAXParseExceptions seem to be a little too low-level. For example, for a failure on an enumeration, I get the validity e...

Reset/remove a border in Swing

Here's a very specific coding question: I've recently been asked to maintain some old-ish Java Swing GUI code at work and ran into this problem: I've attached my own subclass of InputVerifier called MyFilenameVerifier to a JTextField (but it may as well be any JComponent for these purposes). I've overridden the verify() method such th...

Dynamic validation based on selected item in dropdownlist

Hi, In my .aspx page, I have a dropdownlist and a textbox. The textbox has to be validated depending on the selection in the dropdownlist. I have only used the validation control on the .aspx page itself (not codebehind). How can I dynamically change the type of validation on the textbox? programatically? ...

ASP.NET CustomValidator client side

I can't get this CustomValidator working. In the <head>: <script language="javascript" type="text/javascript"> function ValidateFile(sender, args){ alert("Hi"); args.IsValid = document.getElementById("fuFile").value != "" || document.getElementById("c101_c7").value != ""; } </script> In the body...

Dynamically changing the type of validator on a textbox

<asp:DropDownList ID="ddl1" runat="server"> <asp:ListItem Text="First" Value="1"></asp:ListItem> <asp:ListItem Text="Second" Value="2"></asp:ListItem> </asp:DropDownList> <asp:TextBox ID="tb1" runat="server"/> <asp:Button ID="btn1" text="Go!" OnClick="btn1_Click" runat="server" /> public void btn1_Click(object sender, EventA...

Validating against a schema that lives inside a plugin

Background: I have a small problem with Eclipse. I'm working on a workbench plugin which has some classes that validate incoming XML data against a schema. The schema lives inside the plugin project in a "./schemas" folder. Questions: When I run the application, how can I read the schema without using a hardcoded path? When the ap...

how to do a javascript confirm dialog if a radio button is checked, with jquery

I have two radio buttons like so <input type="radio" name="rush" value="yes" /> <input type="radio" name="rush" value="no" checked="checked" /> What I want to do is when the form submit button is clicked, check if 'yes' is selected. If it is, show a javascript confirm dialog I've gotten this far, but am stuck, any help would be appr...

What is the best way to see if a RadioButtonList has a selected value?

I am using: if (RadioButtonList_VolunteerType.SelectedItem != null) or how about: if (RadioButtonList_VolunteerType.Index >= 0) or how about (per Andrew Hare's answer): if (RadioButtonList_VolunteerType.Index > -1) To those who may read this question, the following is not a valid method. As Keltex pointed out, the selected valu...

Intent of Spring form command

Spring's form controller (such as SimpleFormController or BaseCommandController) uses commands to pass data between the HTML form and controller. My question is, is it common practice to use the backing model as the command itself? Or is it common to create a separate command with correspond attributes to those in the backing model. My ...

Is the Validate PEAR package ready for production?

There appears to be a Validate package in Pear that I'm interested in useing in production. Our site has about 20M uniques across 10 languages, so as part of due diligence, thought I'd asked around here. Does anyone have any experience with this PEAR package? Is it ready for production? Here's the Validate package in question: http:/...

Recommended Globalization References

I'm working on a web application that is globalized. The development process is agile style, with several sprints already completed. Our globalization framework is good and localization efforts have been successful so far. However, we continue to run into questions during requirements development, particularly in data storage and vali...

How do I simplify Form Processing in PHP?

I'm been a PHP developer for quite some time now but until today I've not found a simple way to process (aka normalize, sanitize, validate, populate and display forms and it's respective field errors). I know that most of the PHP frameworks nowadays make this job easier but somehow I don't feel like porting all my code to one of these f...

how do i invoke asp.net regExp validator from javascript?

Hello, I'm developing in asp.net 2.0. I'm using the asp:RegularExpressionValidator to check for a valid url. How do I invoke the check from a javascript function? ...

Checking for a valid url using Javascript Regular Expressions

What is the expression I should use in order to check for a valid url in javascript? ...

Reflection for validation

CustomerValidator: AbstractValidator<Customer> How might one dynamically instantiate the class above if passed an instance of a Customer?? Similarly if I had: Cat c = new Cat(); I would want to dynamically invoke the class that implements AbstractValidator<Cat> ...

Rails validation and 'fieldWithErrors' wrapping select tags

Is it normal behaviour to not get the <div class="fieldWithErrors"> wrapped arround select tags that have validation errors? I personally see no reason why the select tags should be treated differently than other form tags (input, textarea). I do get the error in error_messages_for and error_message_on methods for that field. PS. I hav...

WSDL validation error when using MTOM

I am experiencing an issue with WSDL schema validation failing when my web service response contains an MTOM attachment. After searching the web I see I'm not the only one with this problem but have not found any solutions. It seems to fail because the web service response contains an xop:Include element similar to the following, which ...