I'm trying to figure out the best way to validate data within a MVC C# app and xVal seemed to be the best fit. However I'm running into a problem with data type validation.
At first I was doing an UpdateModel into the DTO and then running the validation on the DTO. This worked great for things like required fields, however UpdateModel...
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 ...
I am trying to validate a date entered into a text box. There is an input mask on the textbox which forces input of xx/xx/xxxx. I am trying to use a regular expression validator to enforce that a correct date is entered. I am not skilled in RegEx bascially at all. My co-worker found this one on the internet but I can't really tell what ...
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...
I have a data grid bound to a data source in the typical way (simplified for brevity):
<asp:SqlDataSource ID="ds" runat="server" ConnectionString="xxx"
ProviderName="yyy" SelectCommand="SELECT "a from A where date > ?">
<SelectParameters>
<asp:ControlParameter ControlID="txtDateFrom" Name="fromDate" PropertyName="Value"...
I want to show a modal dialog/pop-up window when the user has not filled in a text field on the page, instead of using an error text field on the page.
If the required text field is filled in, I want the submit button to work as normal (aka call the onClick function), but if it's not filled in, I want a dialogue window/modal pop-up to s...
I am working on a site and I would like to make a user able to enter custom CSS into that will be publicly displayed.
However, seeing as a good deal of XSS attacks can be preformed through CSS, I would like to be able to find a way to "clean" the CSS output, similar to how HTML Purifier works, by parsing the CSS, running the parsed CSS ...
I'm trying to create a simple custom validator for my project, and I can't seem to find a way of getting seam to validate things conditionally.
Here's what I've got:
A helper/backing bean (that is NOT an entity)
@RequiredIfSelected
public class AdSiteHelper {
private Date start;
private Date end;
private boolean selected;
/* g...
The ability to let the model handle its own validation has lead me to begin playing with the MVC 2 preview release. So far, I like the simplicity of the validation scheme. However, I have run into a roadblock. This validation style works fine for simple view model objects. For example if I have a model object named car and I'm lookin...
Hi,
I have a "Reset Password" form being validated by the jQuery Validation plugin. Everything works fine except that I can't get the "remote" part to work with Django. What I'm trying to do is to have remote send an ajax request to my Django backend to check that the "Old Password" is correct as part of validation.
What I'm not sure ...
Hi all!
Please bear with me. I've got the jQuery validation plugin working beautifully in FF, Opera, Safari and IE8. However, IE7 is giving me problems. Our back-end developer insisted on using .Net WebForm to create the form on the server (at least this is what I think she used, it's .aspx is about all I know - I can post some code if...
I'm using xVal in my ASP.NET MVC application, which is great in general. Following Steve Sanderson's blog post, I created a DataAnnotationsValidationRunner to do server-side validation of attributed objects. This works great for a simple class. e.g. Person:
public static class DataAnnotationsValidationRunner
{
public static IEnume...
I'm trying to validate that a user only enters a long value as input (long bigger than 0 actually).
Compare and Range validator has DataTypeCheck for int values only. I was planning on using this class in a CustomValidator but then I would need to write both, client and server side validation code.
Do you know of any other good way of ...
Does rails do any validation for datetime? I found a plugin
http://github.com/adzap/validates_timeliness/tree/master,
but it seems like something that should come in out of the box.
...
How do I change
validates_numericality_of :test, :greater_than_or_equal_to=>0
into validate form
I tried only character and nil values. I need to check also it must be greater than 0
validate change_test
def change_test
if @test.nil?
errors.add_to_base('Hi Test should be only number')
end
end
and also I tried like this,
...
Hay guys, i need help with a REGEX.
I have the got the value of an input box with this.
fileext = filename.split(".").reverse()[0];
I need to make sure this is a jpg, gif or png. Else throw an error.
Thanks
...
Are there simple libraries out there (.NET and Java) that are able to validate a JSON string given a schema definition?
It should work similar to how XML can be validated using XSD.
EDIT: I need .NET and Java libraries. Thanks to darin for the .NET link!
...
I'm trying to make the SideBar function more like Prev/Next buttons. The navigation buttons only check for validation when moving forward; they don't care if you go back. As far as I can tell, you can only have one or the other option on the SideBar, not both. So, here's what I was attempting to do:
<SideBarTemplate>
<asp:DataList I...
I want to force the user to enter any combination of the following words.
the words need to be comma delimited and no comma at the beginning or end of the string
the user should only be able to enter one of each word.
Examples
admin
basic,ectech
admin,ectech,advanced
basic,advanced,admin,ectech
my attempt
^((basic|advanced)|admin|ec...
This may be a bit winded because I am new to wpf. I have created a partial class for an entity in my L2S class that is primarily used for validation. It implements the onchanging and onvalidate methods. I am trying to use the MVVM pattern, and in a window/view I have set the datacontext in the xaml:
<Window.DataContext>
<vm:StartVie...