validation

CodeIgniter form verification and class

I'm using the form validation library and have something like this in the view <p> <label for="NAME">Name <span class="required">*</span></label> <?php echo form_error('NAME'); ?> <br /><input id="NAME" type="text" name="NAME" class="" value="<?php echo set_value('NAME'); ?>" /> </p> I'd like to add a class to...

(rails) how to validate whether an uploaded .txt file is not, say, an image file?

I have a upload text file field, and with it I plan to save the file somewhere and then store the location of the file in a database. However, I want to make sure the file they uploaded is a .txt file, and not, say, an image file. I imagine this happens in the validation step. How does one validate such a thing? Also, how do you get the ...

Free Tool for Validating 2 Databases

I want a free tool for verification all table data between 2 mysql databases ? is there any free tool available on Linux ...

Rails 101 | validates_currency ??

Hi guys, I've searched high and low, but I could not find a solution, to what I think seems like a very common task. In a form I want to have a text input that accepts currency strings (i.e. $1,000,000 or 1000 or $12.12 and in an ideal world even 1 million) In the database I want to keep the value as a integer. What is the best way t...

Axapta Validation Override Always Executes Twice

In most cases, validation methods I've overridden execute twice each time the parent field is changed. Everything still works, but the InfoLog displays double messages every time. Is there any way to prevent this? Thanks public boolean validate() { boolean ret; int exlowValue; int lowValue; int highValue; int exhi...

Nested record validation: need to validate child and parent together

Account < AR has_many :deposits accepts_nested_attributes_for :deposits attr_accessible :max_amount end Deposit < AR belongs_to :account attr_accessible :amount validate :validates_amount_less_than_max_amount def validates_amount_less_than_max_amount # How do you write this method? When an Account is being created w...

a design problem with relatively complicated validations

hi, i have a design problem.. it may seem that i'm giving you too much details, but those are important. say i have a very large input form, with a complicated input, that requires quiet complicated validations, includes validations of relations between different inputs. being probably a very burdensome form for the user, i'd like to g...

Java Bean Validation (JSR303) constraints involving relationship between several bean properties.

Say I have the following simple java bean: class MyBean { private Date startDate; private Date endDate; //setter, getters etc... } Is there a mechanism in JSR 303 to create a custom validator that validates the constraint that startDate must be before endDate? It seems to me to be a common use case, yet I cannot find any exa...

Wpf Combobox Limit to List

We are using Wpf Combobox to allow the user to do the following things: 1) select items by typing in the first few characters 2) auto complete the entry by filtering the list 3) suggesting the first item to match the letters typed as the selected item The challenge is handling the scenario when the user enters characters that are NOT in...

WPF - MVVM - NHibernate Validation

Hi, Im facing a bit of an issue when trying to validate a decimal property on domain object which is bound to a textbox on the view through the viewmodel. I am using NHibernate to decorate my property on the domain object as below. private decimal _refurbishmentFee; [Min(Value=0), NotNull] public decimal RefurbishmentFee { get { r...

Axapta Dialog Validation

I've found several posts and articles around the net talking about validating form fields in dialogs, but none of the examples I've found seem to work properly. Can someone post a complete, concise example of x++ code that generates a dialog containing a single text field, performs simple validation (if text = "abc") on it, and either c...

How to Integrate Enterprise Library Validation Application Block ValidationResults between WCF and ASP.NET?

Enterprise Library Validation Application Block (VAB) integrates with ASP.NET and also with WCF. Is there a way to integrate ValidationResults created in WCF with ASP.NET? e.g. an ASP.NET web page invokes a WCF service. The WCF service validates the data using VAB and returns validation information via a FaultContract. The ASP.NE...

getimagesize() returns false on some images

I'm running getimagesize() to determine whether or not an uploaded file is a valid image and also it's MIME type. A user of my webapp reported that some of his images where getting an "invalid filetype" error after uploading them. So I asked him to send me some of them to check. Here's one. The error string itself is meaningless as it's...

jquery CheckBox required

hello, how can I make a checkbox required ? my code aspx: <asp:CheckBox ID="cbIsAgree" CssClass="{CheckedBox:true, messages:{CheckedBox:'check me!.'}}" runat="server" Text="check me!" /> javascript : $.validator.addMethod("CheckedBox", function CheckedBox(value, element) { return $(element).is(':checked'); } , 'che...

How to validate custom input with many rules

var rules = "Numeric - percentage Informational"; How do I validate an input based on the above criteria? Do I use an array, if so, how do I use it? Split the rules or use jQuery Contains? I have similar rules like the one above to validate my inputs. The rules above will make sure that the input is numeric and a percentage. Informat...

jQuery: Validate if one of many checkboxes is selected (different names, using the jQuery Validation Plugin)

I have a form that has many checkboxes (too many for it to make sense to use their own rules), and I need to use the jQuery Validation Plugin to make sure at least one of them is selected. They all have different names, so most of the solutions I've found so far by Googling don't work for me. However, I came across this post, which I t...

Conditional Validation ASP.NET

I have 2 TextBoxes (textBoxA, textBoxB), both watched by their own RequiredFieldValidator. I want to 'enable' the RequiredFieldValidator for textBoxB just when textBoxA has a value (or meets some specific conditions). Use cases: Case 1 textBoxA = ""; -> Show Required Field Validation Message textBoxB = ""; -> Do not show validation mes...

overriding a value to true and setting the rest to false in rails

Hi guys, this is a really stupid question but I have a deadline and I'm very nervous and I've tried everything. In fact it even worked for a second but I must have broken something. I have a default featured item that I want to be overridden any time I try to feature another item. I had it give an error before but I don't want it to err...

The before_destroy callback prevents child records from being deleted in Ruby on Rails

Because RoR does not offer a validate_on_destroy, I am essentially implementing one by using the before_destroy callback. Using before_destory works and prevents a project that has had effort_logged? from being deleted. The below implementation does not work because when no has been logged I want to delete the project and all of its dep...

Which one I have to follow for W3 Validation?

In W3 validations it have many options HTML - XHTML1.0, XHTML - Transitional, XHTML - Strict and for CSS - CSS - 2.0, CSS - 3.0 ... Which one I should follow? Any suggestion plz ...