Menu
  • HOME
  • TAGS

how to multiply two column names using codeigniter validation rule

php,codeigniter,validation

You done need to do anything with your controller. Add this change your view to <script> function calculate() { var myBox1 = document.getElementById('crop_quantity').value; var myBox2 = document.getElementById('per_rate').value; var result = document.getElementById('income_amount'); var myResult = myBox1 * myBox2; result.value = myResult; } window.onload = calculate(); </script> <div class="control-group"> <label class="control-label">Crop Quantity</label>...

How to change the message in buildRules [CakePHP 3]?

validation,cakephp,cakephp-3.0

When using that style of adding unique rules, you'll have to pass the message to the isUnique() calls second argument, ie $rules->add($rules->isUnique(['email'], 'Este email já encontra-se em uso.')); That is because you are technically creating nested callables this way ($rules->isUnique() creates one, and $rules->add() creates another one), and defining options...

Regualr expression to check ip address with short mask

php,validation,ip-address

Your actual regex is : $regex = "/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/"; and it recognizes an IP like this : 192.168.0.150 If you want to recognize IP with mask (like 192.168.32.4/24) do this regex : $regex = "/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\/([1-9]|1[0-9]|2[0-4])$/"; In this last regex I just add \/([1-9]|1[0-9]|2[0-4]). The \ is used to espace the /....

HTML vs. JavaScript form validation [duplicate]

javascript,jquery,html,html5,validation

but what if the user has js turned off? The same could be said for HTML5 - what if the user is using a browser which doesn't support that? If you're wanting to process data on the server-side you should always perform server-side validation. Front-end validation is primarily used...

spring mvc javax.validation.UnexpectedTypeException: No validator could be found for type: java.lang.String

java,spring,validation,spring-mvc,hibernate-validator

@Past and @DateTimeFormat must be used on Date or Calendar not a String. As bean validation doc says: The annotated element must be a date in the past. Now is defined as the current time according to the virtual machine. The calendar used if the compared type is of type...

Oracle regular expression REGEXP_LIKE for multiple columns

sql,regex,oracle,validation,if-statement

Since they all need to match the same Regex pattern, to be alphanumeric, you can validate on the concatenation of these 3 values: IF REGEXP_LIKE(i.TAX || i.NAME || VarTelephone , '^[A-Za-z0-9]+$') However this does not behave exactly as your question condition, since if just one or two of the values...

Validation in JSF

java,regex,validation

String.contains does not take a regular expression; try String.matches instead. For a regex that only matches numbers and characters, try ^\w+$. This basically says, "match the start of the string, then at least one 'word' character (which is a number or a letter), then match the end of the string"....

How to make text field compulsory only when the checkbox is checked with symfony annotation validations in model classes

validation,symfony2

I find that the @Assert\True() constraint on a method usually works well for me for these sorts of validation scenario. You can add some validation constraints to methods as well as properties, which is pretty powerful. The basic idea is that you can create a method, give it this annotation...

Enum validation in Rails 4.2 doesn't work

ruby-on-rails,validation,enums

Rails enum doesn't have in-built validation. The current focus of AR enums is to map a set of states (labels) to an integer for performance reasons. Currently assigning a wrong state is considered an application level error and not a user input error. That's why you get an ArgumentError. You...

Validate row with inputs in a table that has been built dynamically in AngularJS

javascript,html,angularjs,validation,angularjs-ng-repeat

I've found the answer and it was very simple. Everything worked after me added ng-form in the "tr" tag there I was doing ng-repeat: <tr ng-class="{'danger': item.id.$invalid}" ng-repeat="item in items" ng-form="item.id">...</tr> ...

Java - How to only create an object with valid attributes?

java,validation,object,constructor

The standard practice is to validate the arguments in the constructor. For example: class Range { private final int low, high; Range(int low, int high) { if (low > high) throw new IllegalArgumentException("low can't be greater than high"); this.low = low; this.high = high; } } Side note: to verify...

XML validation: why is explicitly specifying a namespace not allowed in this case?

xml,validation,xsd,xml-namespaces

It is because it in the XSD you have defined, the elementFormDefault is implicitely set to "unqualified". Thus you can't set a namespace prefix to your elements....

Laravel 5 form request validation returning forbidden error

php,validation,laravel,laravel-4,laravel-5

You are getting Forbidden Error because authorize() method of form request is returning false: The issue is this: $clinicId = $this->route('postUpdateAddress'); To access a route parameter value in Form Requests you could do this: $clinicId = \Route::input('id'); //to get the value of {id} so authorize() should look like this: public...

Validating IP never succeeds

java,android,validation,ip,matcher

Change your test in the onPreferenceChange() method, to: IP_ADDRESS.matcher(newValue.toString()).matches() ...

Validation of text fields and contact no text field

java,swing,validation,textfield

Can anyone help me about enabling the button after validating all the text fields? Here is a general purpose class that will enable/disable a button as text is added/removed from a group of text fields. It adds a DocumentListener to the Documenent of each text field. The button will...

How to validate in database for uniqueness?

ruby-on-rails,validation,ruby-on-rails-4

You need to put this validation into you Api model: validates :name, uniqueness: { scope: :status, message: 'your custom message' } http://guides.rubyonrails.org/active_record_validations.html#uniqueness...

FluentValidation - How to customize the validation message in runtime

c#,validation,message,fluentvalidation

As I had a complex scenario, the solution that solved my problem was found here: Custom Validators. Here's the validator code: public class FooValidator : AbstractValidator<Foo> { public FooValidator() { Custom(foo => { var repo = new Repository<Foo>(); var otherFooFromDB = repo.GetByName(foo.Name); if (!otherFooFromDB.Equals(foo)) { return new ValidationFailure("Id", "The foo...

How to perform XML Validation when using ModelDriven?

java,xml,validation,struts2,model-driven

There are a lot of things goin' on here! I'll post them in order of appearance in the question: Never make a POJO extends ActionSupport: public class RegistrationForm extends ActionSupport { must become public class RegistrationForm implements Serializable { Better returning SUCCESS than "success" to prevent typos (but ok this...

How to use javascript to validate the input field for restricting numbers only and setting the range as maximum and minimum

javascript,html,angularjs,forms,validation

<input type=number min=0 max=99999> Brought to you by: For the specification see: WHATWG HTML, section 4.10.5.1.13 For supported browsers see: Can I use: Number input type The Current State of HTML5 Forms: The min, max, and step Attributes For older browsers use: number-polyfill (A polyfill for implementing the HTML5 <input...

Bean Validation message interpolation with array constraint parameter used as variable in message

java,validation,bean-validation

Eventually I found a solution. Validator class: public class BarcodeValidator implements ConstraintValidator<Barcode, String> { private List<Integer> lengths; @Override public void initialize(Barcode barcode) { lengths = new ArrayList<>(barcode.lengths().length); for (int l : barcode.lengths()) lengths.add(l); } @Override public boolean isValid(String value, ConstraintValidatorContext context) { context.unwrap(HibernateConstraintValidatorContext.class).addExpressionVariable("joinedLengths", String.join(" / ", lengths));...

vertical bar chart with with user input and validation

javascript,html,validation,charts

Kentas, here is my entire version of your code with the addition of an input box to get maxPoints: <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>examAnalysis</title> <style type="text/css"> div { float: left; margin-right: 10px; } div p { text-align: center; } </style> <script type="text/javascript"> var participant = []; var maxPoints...

Validator regex pattern input accept only a number with 2-5 digits

regex,validation,jsf

But when I insert some letters instead of numbers like "eee3", the validator shows the following message: "num1: 'eee3' must be a number between -2147483648 and 2147483647. Example: 9346" That's the default conversion error message of JSF builtin IntegerConverter. It will transparently kick in when you bind an input...

Multi-Culture Unobtrusive Validation Of Dates

javascript,jquery,asp.net,validation

Here are a few similar questions: HTML5 change datetime format jquery ui datepicker and mvc view model type datetime The answers seems to suggest 3 approaches: 1) Use jquery globalize to override unobtrusive jquery 2) Add the following script (which is for datepicker control): $.validator.addMethod('date', function (value, element) { if...

“This interface to HTML5 document checking is deprecated” - what's the meaning?

html,html5,validation,w3c-validation

All it means is that the old validator on the W3C's site is no longer able to accurately check the current spec of HTML5 that browsers use. Certain elements (like hgroup) that were in the process of being adopted were ultimately dropped, while others were altered or added. So all...

Accessing the main object in a javax.validation.ConstraintValidator

java,validation

If the validator is supposed to validate two related fields of an object at once, it should validate the object itself, and not one field of the object. And the corresponding annotation should be on the class, and not on a field of the class.

Validating currency allows more than two decimal places [duplicate]

c#,winforms,validation,currency,tryparse

See Find number of decimal places in decimal value regardless of culture to find the number of decimal places. Just verify that it's <= 2. e.g. decimal value = 123.456m; if (GetDecimalPlaces(value) > 2) { // Error } int GetDecimalPlaces(decimal d) { int count = BitConverter.GetBytes(decimal.GetBits(argument)[3])[2]; } ...

How can validate only a certain fields in php Laravel 5?

php,validation,laravel,laravel-5

It should be : $validator = Validator::make($input, [ 'phone' => 'max:20', 'email' => 'required|email|unique:users,email,'. $id , 'address' => 'max:255'] ); It thinks you are passing the first line as the data to check, and the second line as the rules for your validation. It doesn't find an email key so...

Check if the number entered is in array, otherwise add to the array

java,arrays,validation,input,user

How about this? Checks if the value exists, otherwise the user needs to re-enter the number. public static void main(String[] args) { String holder = "", s; int size; s = JOptionPane.showInputDialog("Enter the size of the array"); size = Integer.parseInt(s); String array1[] = new String[size]; //declared and instantiated array1 for...

Regular expression failing to validate xml against xsd

regex,validation

Both regexes are the same, backslash isn't required for colon character. Here is a visual explanation: Which is: 0:0 or 0/1 minus 0/1/2/3 digits 0/1 dot 1+ digit 1 colon 0/1 minus 0/1/2/3 digits 0/1 dot 1+ digit ...

How to validate same, repeated capital and lowercase character in a string?

c#,string,validation

For the first part, just use else if - then the second block will only be executed if the first block isn't. For the second part you could use ToLower or ToUpper so you're comparing all characters in the same case. So, combining these two changes: else if (textBox3.Text.ToUpper().Distinct().Count() ==...

jQuery Code not updating after validation

javascript,jquery,validation,input

You forgot about removing classes: if (checkURL(url)) { $("#url").removeClass('red'); $("#url").addClass('green'); } else { $("#url").removeClass('green'); $("#url").addClass('red'); } You can find jsfiddle here: http://jsfiddle.net/bmkg56hd/...

javax.validation How get property name in a validation message

java,validation

One solution is to use two messages and sandwich your property name between them: @NotBlank(message = "{error.notblank.part1of2}Address Line 1{error.notblank.part2of2}") private String addressLineOne; Then in your message resource file: error.notblank.part1of2=The following field must be supplied: ' error.notblank.part2of2='. Correct and resubmit. When validation fails, it produces the message "The following field must...

Xamarin MvvmCross ViewModel Validation

validation,mvvm,xamarin,mvvmcross

I use MVVM Validation Helpers http://www.nuget.org/packages/MvvmValidation/ It's a simple validation library that's easy to use. It's not tied to MvvmCross. Here's how I use it, for example, in my SigninViewModel: private async void DoSignin() { try { if (!Validate()) { return; } IsBusy = true; Result = ""; var success...

how to use validationResover

validation,typo3-flow

I did it now this way: public function createAction(Object $newObject) { $TS = $newObject->getSomeProperty(); $ABT = $newObject->getSomeOtherProperty(); if ($ABT === 'specialvalue') { $validatorResolver = new \TYPO3\Flow\Validation\ValidatorResolver(); $customValidator = $validatorResolver->createValidator('Your.Package:Foo'); $result = $customValidator->validate($TS); if ($result->hasErrors()) { $this->flashMessageContainer->addMessage(new \TYPO3\Flow\Error\Error('Here you can type in the error message!'));...

Regular expression to validate US phone number with Custom validations

regex,validation

Thanks for the Help. I have created below regex for above requirement, and it works for me. ^\d{0,3}$|^\d{3}-\d{1,3}$|^\d{3}-\d{3}-\d{1,4}$|^\d{3}-\d{3}-\d{4}\s{1}\d{1,4}$|^\d{1,14}$ ...

How to conditionally invoke spring validators

java,spring,validation

There's two ways to do this. You can either create a custom validation annotation and validator which checks the value of method and then applies to appropriate validations to the other fields use validation groups, where you manually check the value of method, then choose which group to use; your...

Symfony form dropdown for entries

php,forms,validation,symfony2

What I would do is simply this : public function buildForm(FormBuilderInterface $builder, array $options) { $builder->add('name', 'text') ->add('client', 'entity', array( 'class'=>'AppBundle\Entity\Client', 'property'=>'name' )); } Hope this helps....

What is a reliable isnumeric() function for python 3?

python,regex,validation,python-3.x,isnumeric

try: float(w.get()) except ValueError: # wasn't numeric ...

RegEx conversion to use with Javascript

javascript,regex,validation

Remove ^ of first and $ from end of regex pattern. And add \ before any character which you want to match by pattern. so pattern is like this: (0[1-9]|1[0-2])\/(19|2[0-1])\d{2} You can test your regex from here...

CSLA How to validate StartDate and FinishDate?

c#,validation,csla

Well, I've finally found solution.It was simple , few lines of code. So , if there's anyone interested in it , here it is. First of all, we need to create class and override Execute method inside. public class StartFinishTimeValidation : Csla.Rules.BusinessRule { protected override void Execute(Csla.Rules.RuleContext context) { var...

jQuery validate equalTo

javascript,jquery,validation

I have done a quick hack to solve this. It works well although this may not be the preferred way to do it. Add a hidden input #fullname Populate the hidden input with the value of first and last name separated by a space Validate the signature agianst the hidden...

How access element attribute inside Parsley Validation

validation,parsley.js

The current version doesn't really give you access; everything you need should be in requirement. It could be an array with multiple values, though. A future should allow you to access any attribute starting with data-parsley-filetype-, but there's no way to know from your example what you are actually trying...

Restrict angular form submit on mobile

angularjs,validation

Try using ngSubmit directive to handle form submission. The angular way is to trigger the search request to the server via $http or similar, not page reload. Your current setup is a typical html form, which sends the data to /Search endpoint via get in submission. Even in desktop browser...

Validator EmailAddress can validate an array of email

php,validation,email,zend-framework2,jquery-select2

Why are you not embracing OOP? Create new validator for this: namespace YourApp\Validator; use Zend\Validator\EmailAddress; class EmailAddressList extends EmailAddress { public function isValid($value) { $emails = array_map('trim', explode(',', $value)); foreach ($emails as $email) { if (!parent::isValid($email)) { return false; } } return true; } } and in your validator spec:...

How can I make a “*required field” error message appear for a drop down menu in a validating PHP form?

php,forms,validation,drop-down-menu,server-side

The span <span class="error">* <?php echo $rateErr;?></span> is inside the select...I bet if you inspected the element it does appear just not visible because it's not in an <option> tag. Try moving it outside....

Struggling with PHP validation

php,jquery,html,twitter-bootstrap,validation

The code needs to check for any error messages and stop execution before sending out the email. Something like the following which would be inserted after the validation checks: // Gather all errors into an array $errors = array($emailErr, $firstErr, $lastErr); // Remove any empty error messages from the array...

Validation on Radio Buttons

c#,wpf,validation,data-binding,radio-button

In my opinion you have 2 solutions: the first one - the easiest one - is to set a default for Gender property. In this way one among the two radiobuttons will be check and the "required" attribute will be always satisfied. The second solution is to "mask" a ListView...

Manually highlight all invalid inputs of Angular Form

javascript,angularjs,forms,validation

You form markup should look like, so that when you click on submit ng-class will add submitted class on form that will give you idea that whenever you have submitted class on form and field has ng-invalid class, you can highlight those element Markup <ng-form name="form" ng-class="{submitted: submitted}" ng-submit="submitted=true; submit();">...

Dynamic annotation/attribute values

c#,validation,annotations,attributes

All true. You can not. Despite you wrote you can not use enums, this actually can serve a solution: Pass enum parameter to your attribute and use this parameter in the attribute constructor's logic/algorithm to implement your extended logic. Note: This is exactly opposite of some DPs so we safely...

How to successfully implement WPF textbox validation?

c#,wpf,validation,xaml,visual-studio-2012

Using what you posted, it works fine for me, it produces the red "!" above the textbox. However, I DID remember to set my DataContext, ie. public MainWindow() { InitializeComponent(); this.DataContext = this; } Without this, it won't work....

Yii2 required validation on update

php,validation,yii2

ActiveRecord does not set scenario automaticaly when you update or create items. You must override update() method in your model and set scenario that you need. E.g. in your case public function update($runValidation = true, $attributeNames = null) { $this->scenario = 'update'; return parent::update($runValidation, $attributeNames); } Also you can set...

Javascript/jQuery form validation

javascript,jquery,forms,validation

Add an onchange event to your text inputs that will remove the error message. Rather than making a count of valid fields, I would also check for the existence of error messages. This will make it easier to add more fields to your form. function checkName(e) { //gather the calling...

JSON (schema) validation with escaped characters in patterns fails

json,validation,escaping

You need to double escape here. The slash is an escape character in json so you can't escape the dot (as it sees it) instead you need to escape that backslash so your regex comes out with \. like it should (json is expecting a reserved character after the escape...

JavaScript validation on name field not working

javascript,forms,validation

You simply forgot to add the + sign at the end of your letters RegExp. i. e. var reg_letters = /^[A-ZÆØÅa-zæøå]$/; should be var reg_letters = /^[A-ZÆØÅa-zæøå]+$/;

MVVM - Validating the model when a field in the viewmodel is changed

c#,wpf,validation,mvvm,ef-database-first

How about validating the whole person object in your Validate() methode, not just a single property?

Rails 4 validation conditional on value of a hidden field

ruby-on-rails,validation,conditional,hidden-field

You should do <%= f.hidden_field :update_type, :value => "email_only or password_only" %> ...

How to make a valid
  • link
  • html,css,validation

    This format is invalid <a href="index.html"><li class="invalid nav-item">invalid</li></a> Valid format is <li class="invalid nav-item"><a href="index.html">valid</a></li> As for your concern anchor filling up the space of li, little css trick will solve it. a { text-decoration: none; display: block; width: 100%; height: 100%; } ...

    Seeding fails validation for nested tables (validates_presence_of)

    ruby-on-rails,ruby,validation,ruby-on-rails-4,associations

    Found this : Validating nested association in Rails (last chapter) class User belongs_to :organization, inverse_of: :users validates_presence_of :organization_id, :unless => 'usertype==1' end class Organization has_many :users accepts_nested_attributes_for :users, :reject_if => :all_blank, :allow_destroy => true end The documentation is not quite clear about it but I think it's worth a try....

    how can I return the validation errors for a REST call?

    validation,cakephp-3.0

    This is what I would do, check for validation-errors in your controller and send them to the view serialized public function add() { $this->request->allowMethod('post'); $data = $this->Model->newEntity($this->request->data); if($data->errors()) { $this->set([ 'errors' => $data->errors(), '_serialize' => ['errors']]); return; } //if no validation errors then save here } ...

    How to validate non-db attributes on an ActiveRecord model?

    ruby-on-rails,validation,activerecord

    You can use =~ operator instead to match a string with regex, using this you can add a condition in setter methods def resolution=(res) if res =~ /\A\d+x{1}\d+\d/ # do something else # errors.add(...) end end but, as you have already used attr_accessor, you don't have to define getter and...

    Verifying whether a decimal value is a valid [closed]

    ruby,string,validation

    If I understand your question correctly ^(0\.\d{3}|[1-9]\.\d{2}|10\.00)$ online test...

    Django form for querying database. Is form.py needed and how to leave fields empty for query?

    forms,validation,python-3.x,django-forms

    The query You should use a Q object for similar queries. from django.db.models import Q Incident.objects.filter( Q(incident_id=incident_id) | Q(equipment_id=equipment_id) ) More on Q objects. Also, IMO this code needs to live in some Form class. If it was me, I would have put this code in some The form class...

    How to avoid Hibernate Validator ConstraintDeclarationException?

    java,spring,hibernate,validation,hibernate-validator

    To answer your first question. The behavior is specified in the Bean Validation specification section 4.5.5. Method constraints in inheritance hierarchies. Basically the rule is that a method's preconditions (as represented by parameter constraints) must not be strengthened in sub types. This is the so called Liskov substitution principle. To...

    MVC 5 - Validate a specific field on client-side

    javascript,jquery,asp.net-mvc,validation,asp.net-mvc-5

    After digging around in the source code, I've come to these conclusions. First, the purpose of unobtrusive is to wire up the rules and messages, defined as data- attributes on the form elements by MVC, to jQuery.validation. It's for configuring/wiring up validation, not a complete wrapper around it, so when...

    Implementation of IDataErrorInfo, excessive use of if-statements

    c#,entity-framework,validation,mvvm-light

    This is an approach (I usually do this). I use EF data annotation (in my case I map every entity with EF data annotation and with EF fluent interface for relations). I usually inherit from an EntityBase with standard IDataErrorInfo. This is a piece of my EntityBase public class EntityBase...

    Is there a way to override default CSS of HTML5 form validation messages

    css,html5,validation,background

    ::-webkit-validation-bubble-message Will only partially work on chrome and safari. ultimately you can not style these at the moment the are browser/OS specific. You can change the messages with JS but that's as much as you can get away with at the moment....

    How to validate only after leaving focus of paper-input (Polymer 1.0)

    validation,focus,polymer

    I was able to only validate my input after leaving focus by using the onfocusout attribute <paper-input id="zip" label="ZIP Code:" pattern="\d{5}([-]\d{4})?" error-message="This is not a valid ZIP Code" onfocusout="validate()"></paper-input> ...

    FluentValidation NotEmpty and EmailAddress example

    c#,validation,refactoring,fluentvalidation

    You can just chain them together, it's called Fluent Validation for a reason. RuleFor(s => s.Email).NotEmpty().WithMessage("Email address is required").EmailAddress().WithMessage("A valid email is required"); ...

    MVC HTML Helpers: Get all validation attributes

    c#,asp.net-mvc,validation,html-helper

    the values like the error message, etc, are exactly what I need. As Stephan said in his comment, you don't have to go after getting the values for such data annotation attributes as it will be only and only duplication of work. If you really wanna encapsulate your form...

    Validate value of input with angularjs

    javascript,jquery,angularjs,validation

    If I understood you questions correctly then you can change your code like this. $scope.init = function () { var url = window.location.href; var urlParts = url.split('?='); var accountId = urlParts[1]; if (!accountId) { alert("ERROR"); } else { $scope.accountNumber = accountId; } } ...

    Correct PHP contact form syntax? [duplicate]

    php,forms,validation

    The first time you load the form, $_POST will not have anything populated. Try changing if ($_POST["submit"]) { to if (isset($_POST["submit"])) { to determine if the form was in fact submitted and continue accordingly....

    Validation on other when more than one checkbox is checked

    javascript,jquery,validation,checkbox

    Try this : change your button type="button" and call below script. $(function(){ $('.next-page').click(function(){ var checkCount = $('input[name="qual-form-2[]"]:checked').length; //check atleast one checkbox checked if(checkCount > 0) { var checkOther = $('input[name="qual-form-2[]"]:last'); var checkNotOther = $('input[name="qual-form-2[]"]:checked').not(checkOther); //if 'other' and any of the rest is checked show alert if(checkNotOther.length > 0 && checkOther.is(':checked'))...

    MS Access validation rules not firing in subform

    vba,validation,ms-access,access-vba,ms-access-2013

    Use the form's Before Update event to check whether FromDate is Null. When it is Null, notify the user and cancel the update (Cancel = True). Keep your existing Validation Rule for the text box. That will give the user immediate feedback if they attempt to delete a value from...

    Is there a shorter/better way to validate request params?

    python,validation,python-2.7,flask,werkzeug

    Yes. The args attribute of a Flask/Werkzeug Request object is an ImmutableMultiDict, which is a subclass of MultiDict. The MultiDict.get() method accepts a type argument which does exactly what you want: count = request.args.get('count', DEFAULT_COUNT, type=int) Here's the relevant section of the docs: get(key, default=None, type=None) Return the default value...

    Symfony2 form builder without class check if multiple fields are empty

    validation,symfony2,constraints,formbuilder

    the easiest solution is to just set both as required ... but.. on post you could check as simple as if( empty($form->get('name')->getData()) && empty($form->get('dob')->getData())){ $form->addError(new FormError("fill out both yo")); // ... return your view }else { // ... do your persisting stuff } ... the symfony way would possibly be...

    angular validation not working on select

    javascript,angularjs,validation

    You need to remove the setter $scope.CurrCustomer.Logic = false; from your controller that is filling that ng-model and making it valid on controller load. After filling that CurrCustomer.Logic value it become valid input as it is required.

    mvc 4 custom format validator does not show error and allows the form to submit

    asp.net-mvc,validation,asp.net-mvc-4

    In order to get client side validation, your attribute must implement IClientValidatable and you must include a client side script that adds a method to the client side $.validator object. This article THE COMPLETE GUIDE TO VALIDATION IN ASP.NET MVC 3 gives some good examples of how to implement it....

    multiple type of Validation through javascript

    javascript,validation

    Something like this ? var method = document.getElementsByName('fieldset1'); var ischecked_method = false; for ( var i = 0; i < method.length; i++) { if(method[i].checked) { ischecked_method = true; break; } } if(!ischecked_method) { alert("Please choose something!"); } DEMO EDITED : http://jsfiddle.net/0sw19Lt1/13/...

    “Validation error: PayPal currencies do not match” in WooCommerce

    wordpress,validation,paypal,woocommerce,currency

    i found temporary fix for this problem go to “plugins/woocommerce/includes/gateways/paypal/includes/class-wc-gateway-paypal-ipn-handler.php” and comment two lines (line number : 176 and 177 ) like this //$this->validate_currency( $order, $posted['mc_currency'] ); //$this->validate_amount( $order, $posted['mc_gross'] ); Source : https://www.kapadiya.net/wordpress/woocommerce-paypal-for-inr/...

    C# Validate DataSet filled with DGV data as XML

    c#,xml,validation,datagridview,xsd

    If the question is why can't the file be deleted, it is because the XmlReader has the file open - call read.Close() before trying to delete the file.

    Create data validation list when some of the values have commas?

    excel,vba,validation,excel-vba

    In data validation with Type:=xlValidateList the Formula1 can either be a comma separated list or a formula string which is a reference to a range with that list. In a comma separated list the comma has special meaning. In a reference to a range it has not. So supposed your...

    Can't validate a form in Bootstrap Modal using JavaScript

    javascript,jquery,forms,validation,bootstrap-modal

    There are many plugins to help you with form validation, but for a single form with 4 elements it's probably not needed. Your "Contact form 7" classes should validate the elements, but since you have a few javascript errors on your site (check console) I guess it's not working like...

    password check directive elem.add error

    javascript,angularjs,validation,events,angularjs-directive

    Your jQuery is missing. But I would suggest you to use scope variable inside you directive that you have access to scope of controller to your directive, Because is not creating isolated scope. Code angular.module('myModule') .directive('pwCheck', function() { return { require: 'ngModel', link: function (scope, elem, attrs, ctrl) { var...

    Veridis Biometrics SDK validating with strings

    .net,validation,biometrics

    Ok, if this serves anyone in the future, this is how I've solved this. Short version: The SDK actually always saves one or 3 samples of the same finger only! Long version: Firstly, I thought I was collecting 1 sample of each of the 3 fingers I'd input. It was...

    Cornice schema validation with colanderalchemy

    python,validation,sqlalchemy,pyramid,colanderalchemy

    This appears to be due to the issue of colander having both a typ property and a schema_type property. They're both supposed to tell you the schema's type, but they can actually be different values. I filed an issue with colander, but if there's a fix it'll likely not make...

    Codeigniter Form Validation Rule for match (password)

    php,forms,codeigniter,validation

    There is no need of putting old password has in hidden field. it's not even safe. you can create callback function for your own custom validation. Notice the comment i have did in following code. $config=array( array( 'field' => 'old_password', 'label' => 'oldpass', 'rules' => 'trim|required|callback_oldpassword_check' // Note: Notice added...

    Cannot set property 'innerHTML' of null Javascript validation

    javascript,validation,null

    The problem is you are using EmailError in your getElementById as the id but it is emailError. IDs are case sensitive. Another way to debug such an error is to use the Google Chrome debugger or another development tool to catch uncaught exceptions and look to see which getElementById is...

    Using JavaScript or JQuery to clear a file upload field if the file selected is not a certain type [duplicate]

    javascript,jquery,html,validation,file-upload

    You can simply use a regex to check if it has that extension. If yes, do whatever (add the value to your disabled field). If no, do whatever (cancel the upload, show an alert). document.getElementById("uploadBtn").onchange = function () { if (this.value.match(/\.(pdf|docx)$/)) { document.getElementById("uploadFile").value = this.value; } else { this.value =...

    Regex tom match percentage upto 2 decimal places

    regex,validation

    Use can use this regex: ^((?:|0|[1-9]\d?|100)(?:\.\d{1,2})?)$ Try it...

    how to get validated the associated attributes? rails4

    ruby-on-rails,validation

    Use valid? method. It will trigger validations defined in model and return true or false. if @man.valid? @man.save else #do smth else Further reading: http://guides.rubyonrails.org/active_record_validations.html#valid-questionmark-and-invalid-questionmark...

    Validation of a form before submission

    php,validation,symfony2,form-submit

    In place of: $form->submit($request->request->get($form->getName())); Try: $form->submit(array(), false); ...

    Input validation setTimeout in ReactJS

    javascript,css,validation,reactjs,ecmascript-6

    You need to fix the following line of code: if (isValid === false) { setTimeout(this.setIsValid(isValid), 2000); } What you are doing here, you are basically calling this.setIsValid instantly and passing to setTimeout the result of it. So the state is changed instantly. What you WANT to do, you want to...

    In CodeIgniter 2.2.0, why does the form validator not invoke my custom validation routine on array input data?

    php,codeigniter,validation,codeigniter-2,codeigniter-form-helper

    After some debugging, I found that Form_validation::_execute() (in system/libraries/Form_validation.php) has a $cycles variable, a zero-based integer, that measures the number of times any particular rule has been invoked on array-based input. Unfortunately, the __execute() function uses this $cycles variable to reference elements of the post data (e.g., line 552 in...