custom-method

How to disable custom validation method on condition

I use jQuery Validation plugin to ensure what user entered positive *cost_of_car* in first text field and positive *payment_amount* in second text field such what *cost_of_car * 0.4 <= payment_amount <= cost_of_car*: $.validator.addMethod("testMaxAmount", function() { return $("#cost_of_car").val() - 0 >= $("#payment_amount").val() ...

jQuery validation custom method didn't work

Hello all I have added a method on jQuery validator like this $.validator.addMethod('myEqual', function (value, element) { return value == element.value; // this one here didn't work }, 'Please enter a greater year!'); $.metadata.setType("attr", "validate"); $("#educationForm").validate({ showError...

Rails does not display error messages on a form in a custom method

Hi all, I've created a custom method called checkout in my app. I create an order (which is done my adding products to my "cart"), assign it to my client, and then I head to my checkout screen where I confirm the items and enter their customer order number and complete the order (submit). Everything works great except that it doesn't d...

Custom Method in LINQ to SQL query

Is it possible to use custom method In query for example: var result = from u in context.MyTable where MyMethod(u) == 10 select u; ...