Hi,
I recently plugged the NHibernate validation into my app, I've decorated the properties of my domain objects with the NHibernate attributes as so ...
[NotEmpty, Length(Min = 1, Max = 40)]
public string Description { get; set; }
I've also implemented IDataErrorInfo on my Domain Object ...
public string this[string co...
I have been trying to get these two plugins playing well all day. Currently if you hit submit, it will submit the empty form, and if you hit it again, it will validate (and not submit). I feel I am missing something obvious.
$(document).ready(function() {
$('#form_contact').submit(function() {
return false;
}...
I am using $_GET, $_POST and $_COOKIE variables in method calls, SQL queries and file calls - and it is necessary to escape / rewrite this user-data for better security (avoid injection attacks and the like). How would you recommend this is done?
Some ideas from built-in escape function ... to get the juices flowing:
Add backslashes t...
Hello all,
I would prefer to use an asp.net Validation Control as I currently have other Validation Controls within the same View. I need to error messages to be displayed wihtin a Validation Summary.
I have two textboxes and I need to make sure than textboxA is LessThan textboxB.
I have used the CompareValidator and have set the prop...
Hi!
I have a groovy system configured using tomcat and Oracle 10g.
I have a groovy class which defines an follows: (reduced version)
class ChangeTicket {
static constraints = {
chngNr(nullable:false)
}
String chngNr
}
My controller has defined a save method:
if (changeTicketInstance.validate() && !changeTicketInstance.hasErr...
We had an issue with the text editor on our website that was doubling up the URL. So for example, the text field may look contain:
This is a description for a media item, and here in <a href="http://www.example.com/apage.htmlhttp://www.example.com/apage.html">a link</a>.
So pretty much I need a regex to detect any string that begi...
I have a payment page where a customer is entering their credit card details. I have removed all of the non-relevant sections.
What's weird is that my front-end validation works fine on FF, IE, and Safari for windows. It only is failing on Safari in Mac OSX.
Specific user agent strings that have had issues:
Mozilla/5.0 (Macintosh;...
Let's say I have a POCO like so:
public class Name
{
public string FirstName { get; set; }
public string LastName { get; set; }
}
FirstName and LastName cannot be null. Should I add in a method like this:
public List<Error> Validate()
{
var errors = new List<Error>();
if (String.IsNullOrEmpty(FirstName))
erro...
I have read here that all ASP.NET validators have a property called: isvalid which can be used in the client side. However, I hav tried to access this property in the client side as following but with no luck:
alert(document.getElementById("validator_clientID").isvalid);
Do you have any idea why this is not accessible?
Your help is ap...
I'm looking for clean and short code to test validations in Rails Unittests.
Currently I do something like this
test "create thing without name" do
assert_raise ActiveRecord::RecordInvalid do
Thing.create! :param1 => "Something", :param2 => 123
end
end
I guess there is a better way that also shows the validation messa...
Hey guys,
I'm working on a c++ program and I need to take in a binary number from 0-255, inclusive, as a string(it has to be a string). What can I write in a while(input invalid) loop to check that the string is between 00000000 to 11111111, inclusive. Thanks so much
...
Is there any library which can be used to validate chess moves and simulate games in .NET? It would be great if the library can understand moves in Algebraic notation and also provide simple API for making moves. For example, game.Move("E2","E4") etc. In the second case, the library should be able to generate Algebraic notation for the m...
Hi friends,
I have 2 different scripts, one is jquery post for form, and second is jquery form validation.
I run post script at submit button click action, so it takes effect before validation :/ and i could not change validation to run before post script :( so now it form submitting without validating.
How can make it? Appreciate hel...
Bear with me, it's been a while. :)
What is a good way to validate command-line arguments passed to an MS-DOS batch script?
For example, here is what I want to do:
IF "%1"=="" throw "Missing 1st argument: Machine Name"
IF "%2"=="" throw "Missing 2nd argument: File Path"
...
Hello, is it possible to use validation without the Binding part? The thing is my textbox is not bound to any object, but I still want to validate it's content. The only way I've found so far is this:
<TextBox Grid.Row="0" Grid.Column="1" MaxLength="50" x:Name="textBoxTubeName" Margin="5,5,0,5">
<TextBox.Text>
<Binding Path="Name"...
I'm using Eclipse 3.5 with the FreeMarker template plugin, and it's showing me a syntax validation problem that I don't care to see.
How do I turn this validation off, or possibly downgrade this template error to a warning? In previous versions of Eclipse, I'd probably look under Window -> Preferences -> Validation, but I don't see tha...
I have a system where users insert many types of things ("incidences") and all of them have to be approved by an admin. Which pattern will be useful for this case? Maybe validation is not the word for this.
Update: The problem is that the db where the data resides can't be changed. All the moderation things will be done in another db an...
In a similar vein to a previous question of mine
I need to validate a group of select inputs for order of voting preference. This time I've had to change it slightly.
The options to a user would be something like:
Choose in order of preference
1: [select with options]
2: [select with options]
3: [select with options]
The hash that t...
I'm trying to add Validation to a Silverlight 3.0 TextBox but cannot seem to find and example which is complete, and not missing functionality that makes it work, I have this property:
''' <summary>Tag</summary>
''' <value>String</value>
''' <returns>String</returns>
''' <remarks>Contains Validation</remarks>
Public ...
How can I create a validator that validates if the user inputed the same values in the password field and the password confirmation field?
I did it in the managed bean, but I prefer to do it using a JSF validator...
The real question is, how to create a validator that access other JSF components other than the component being validated...