Questions tagged [validation]

27136 questions
1

votes
1

answer
2.6k

Views

Swagger 3.0 schema error “should NOT have additional properties”

What does this error below mean? (Running in Swagger Editor) Schema error should NOT have additional properties additionalProperty: /buildinfo, /clearcache, /countries/{countryId}/cinemas/{theatreid}/screens/{screenid}/layout, /countries/{countryId}/cinemas/{theatreid}/screens Jump to line 0 Below i...
peter ivarsson
1

votes
2

answer
225

Views

Flutter: how to avoid special characters in validator

I have this validation function: class FormFieldValidator{ static String validate(String value, String message){ return (value.isEmpty || (value.contains(**SPECIAL CHARACTERS**))) ? message : null; } } I would like to indicate that doesn't have to contain special characters, but how can I say it?
Little Monkey
1

votes
1

answer
61

Views

In WSO2 ESB is validate XML before coming to the api

Is there a way to validate XML coming to the WSO2 ESB API since in order to validate. I'm getting an error when the wrong XML comes to my API. This is the error I'm getting when it comes to the API I want to validate before that. [2018-10-19 10:00:03,531] ERROR - LogMediator Could not build full log...
Malinda Peiris
1

votes
2

answer
46

Views

Spring - Validate the field of a field

I am developing an API with Spring boot in which I have an object which has another object which has a field that I need to validate. These are the following: CodigoDTO public final class CodigoDTO { private String codigo; @JsonProperty(access = JsonProperty.Access.WRITE_ONLY) private String accion;...
Wrong
1

votes
4

answer
2.3k

Views

password and confirmpassword validation in angular using reactive forms

i have attached my code below .im facing problem in adding password mismatch validation.im not getting validation error if i type mismatching password register.component.html UserName:* UserName is required Password:* password is required minimum of 6 characters required ConfirmPassword: * confirm...
swagath
1

votes
3

answer
37

Views

How to use multiple input field class name in jquery for validation

Suppose I have a form of two input field Now I want to validate these two input fields sing jquery. For that I am using $('.registration-form input[class='require']).on('focus', function() { $(this).addClass('input-error'); }); But here is not validation working. But if I have use $('.registration-...
Arafat Rahman
1

votes
2

answer
29

Views

Is possible to validate file size and extension before upload at the same time?

I have succeeded in validating the file extension with jquery but when I tried to validate the file size, I have problem that my code is not working. I using newest jquery version. PROBLEM EXTENSION AND SIZE FILE VALIDATION CODE HERE : (function($) {$.fn.checkFileType = function(options) { var defau...
Hana Journey
1

votes
6

answer
10.1k

Views

Validate Emails with Bash

I try to validate an email with a shell script. Is there a easy example to validate a mail? Asked google but just found crap and PHP (also crap..). Thanks and regards.
fwaechter
-1

votes
0

answer
31

Views

JSON validation on Java

I want to make validations on the backend side, for a JSON structure received from the client. JSON example from frontend: { 'status': { 'type': 'string', 'value': 'test' }, 'validFrom': { 'type': 'number', 'value': '123123123' }, 'customerData': { 'type': 'map', 'value': { 'customerName': { 'type':...
Alex
1

votes
1

answer
28

Views

Validation input field Fullname(Firstname,Lastname) - JavaScript

Need validation for full name(first name/last name - 1 input field). I`m new in this sphere and can't formulate the right syntaxis..maybe will work with a regular expression too... function validateForm() { var name= document.getElementById('name').value; var x = name.indexOf(' '); var fname = name....
Todor Markov
0

votes
0

answer
2

Views

how to override default Django form validation error

I try this but it doesn't work. default error message is shown only.please help from django import forms from SharedApps_Application.models import certificateDb from django.contrib.admin.widgets import AdminDateWidget from django.forms.fields import DateField my_default_errors = { 'required': 'Appl...
A500010
1

votes
1

answer
337

Views

How to prevent insertion of invalid dates into a SQLite table?

SQLite tables can't have a column of type date or timestamp. Dates are stored as either text or a number. That being the case: How can I prevent an invalid date like February 31st from being inserted into a table? I'm know you can validate the date in the application before inserting, but that's no...
Tulains Córdova
1

votes
2

answer
24

Views

How to add validation to contact form?

I am trying to add a contact form for users to fill and it will automatically email to the main account. I am unsure as to how I can add validation to the form so users are not able to click 'Send Email' without filling in the fields. I have currently tried adding Website: app/views/contact_mailer/...
Krupa
1

votes
1

answer
3.2k

Views

NoSuchMethodError during validator test (javax.el 3.0.0)

I try to test validator (hibernate-validator 5.1.3.Final) in spring context. If object is valid test is OK. But if object has invalid fields the error is java.lang.NoSuchMethodError: javax.el.ExpressionFactory.newInstance()Ljavax/el/ExpressionFactory. Validator works correctly on the tomcat 8.0 ser...
Dmitriy Kozlov
0

votes
0

answer
9

Views

How to redirect after form validation?

I'm trying to set up a redirect after my form validation script runs. But when I click submit it throws my requires a valid email error and then redirects skipping my validation checks. Currently I've tried adding the function in at the bottom of my js file. But it redirects with out running the val...
AL1ENB0Y
1

votes
1

answer
331

Views

Dynamically adding item to Sitecore - item name must satisfy the pattern

My pattern is actually: ^[\w\*\$][\w\s\-\$]*(\(\d{1,}\)){0,1}$ EDIT - for clarity, I do not have this pattern written in my code, but I get an error thrown that says 'name does not satisfy pattern ^[\w*\$][\w\s-\$]*((\d{1,})){0,1}$'. I think this is a Sitecore setting? I'm not sure where it's determ...
1

votes
4

answer
2.6k

Views

Allow string to be null or empty in joi and express-validation

I am using 'joi': '10.0.6' and 'express-validation': '1.0.1' in my project to validate a JSON object which I will save in the DB. One of the field is a string but it could be null or empty. How can I allow my string to pass the validation in the cases it is empty or null? I have already tried these...
dventi3
1

votes
1

answer
1.3k

Views

Pass an array to custom validator Angular

My template: Please enter a value from the array My custom validator: export class CustomValidators { public static arrayIncludes(arrayIncludes: string): ValidatorFn { return (control: AbstractControl): { [key: string]: any } => { if (isPresent(Validators.required(control))) { return null; } let arr...
Riddle00
1

votes
1

answer
10.8k

Views

confusionMatrix for logistic regression in R

I want to calculate two confusion matrix for my logistic regression using my training data and my testing data: logitMod = 0.5, train$LoanStatus_B == 1)) And the the code below works well for my training set. However, when i use the test set: confusionMatrix(table(predict(logitMod, type='response')...
Pumpkin C
0

votes
0

answer
14

Views

R check if column exists and if it does check something about it

Hi I want to check if a column in a data.frame exists, and only if it does check another conditions. I know I can use a nested if statement as I have in the example. This is normally for checking inputs to functions. This is a working example which gives me the output I want, I just was wondering i...
user2738526
1

votes
1

answer
481

Views

Fitting in nested cross-validation with cross_val_score with pipeline and GridSearch

I am working in scikit and I am trying to tune my XGBoost. I made an attempt to use a nested cross-validation using the pipeline for the rescaling of the training folds (to avoid data leakage and overfitting) and in parallel with GridSearchCV for param tuning and cross_val_score to get the roc_auc s...
inatos
1

votes
1

answer
648

Views

asp.net core select validation with data annotation not working

I have spent a remarkable amount of time to find out but I couldn't. When I post my model without selecting any option - in fact selecting 0 - Select - option, the Required validation is not working. I also tried removing the programatically added default option from service code to the view code,...
ibubi
1

votes
2

answer
62

Views

Spring validator custom HTTP status

I'd like to return a custom HTTP status 422 instead of a default 400 on a spring validation. My validator: @Component @RequiredArgsConstructor public class EmailUpdateDtoValidator implements Validator { private Errors errors; private EmailUpdateDto emailUpdateDto; @Override public boolean supports(C...
James Carter
1

votes
3

answer
53

Views

ReactiveForms Angular validation

I have some reactive form like this: this.form = this.formBuilder.group({ filter: [''], filterReason: [''], documentsRequired: [''], urgencyReason: [''], reportRequestedDate: [''], urgencyDate: [''], urgencyRemarks: [''] }); And some value like this: validation = false; The problem I have is that i...
Miomir Dancevic
1

votes
4

answer
75

Views

javascript : How to prevent user from entering = in textbox?

I have a requirement where i have to prevent users from entering = in textbox in entire application to prevent vulnerability. I have been using antisamy-1.4.4.xml and XSSFilter.java which takes care of quite a few vulnerability checks but does not check for '=' sign entered in textbox. Is there anyw...
sTg
1

votes
2

answer
102

Views

Check whether a string contains numbers

I have input values like: string = 'devid' string = 'devid123' string = 'devid.123.devid' I need to sort strings that contain .(number)., for example 'devid.123.devid'. How can I separate only strings that consist of .(numbers). like .123.? Help me find a solution. In a controller, I have: @person =...
Srk
1

votes
4

answer
54

Views

How can I validate an XML doc which has ampersands inside any of elements without getting an exception?

I have a non-editable XML file which has a few unwanted tags placed in between, so I get an exception when I validate the XML document using XML::Simple. This is expected. my $xml = new XML::Simple(); if (eval { $xml->parse('sample.xml') }) { print 'success!!\n'; } else { print 'failed!!!\n'; } Ho...
Kalesh
1

votes
2

answer
46

Views

How to perform SMOTE with cross validation in sklearn in python

I have a highly imbalanced dataset and would like to perform SMOTE to balance the dataset and perfrom cross validation to measure the accuracy. However, most of the existing tutorials make use of only single training and testing iteration to perfrom SMOTE. Therefore, I would like to know the correct...
Emi
1

votes
2

answer
28

Views

How to fetch default value from an input into a servlet?

I have an input type which has a default value. I want to fetch its value inside of a servlet. So, which method will work in this case? I tried using request.getParameter('FLC1'), but that didn't work as well. Following is the input code:- Thank you
1

votes
2

answer
48

Views

How to fix generic dialog in validation prompt

In a Search action I have an optional input with validation. action (MyAction) { type (Search) collect { input (name) { type (Name) min (Optional) iterable validate { if (!exists (name)) { prompt { dialog ('Write the name you want me to look up.') } } } } } // end of collect I expect a prompt for th...
Jan Jankowski
1

votes
3

answer
81

Views

How to add hours and minutes to date pattern?

I'm trying to validate an input field in which I set the date and time using a datetime picker. How can I add h:m to the pattern of the field so it's like dd.mm.yyyy hh:ii?
Moses
1

votes
2

answer
979

Views

Validate more than two words as minimum on asp:textbox

Hello I want to validate the input, so the method for count words is the following : public static string validateisMoreThanOneWord(string input, int numberWords) { try { int words = numberWords; for (int i = 0; i < input.Trim().Length; i++) { if (input[i] == ' ') { words--; } if (words == 0) { ret...
Jonathan Escobedo
0

votes
0

answer
101

Views

Excel Data Validations corrupt worksheets (when copying?)

Edit: I further looked into this issue and have now a minimal file in which I can reproduce the error/bug. All Add-Ins are deactivated and I use only 4 lines of VBA-Code: Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) Tabelle15.Range(Target, Target.Offset(1, 0)).En...
be_kehrer
1

votes
3

answer
7.1k

Views

Spring validations default messages

I need to get the resolved error messages programmatically in the controller. The default validation message for typeMismatch errors are not populating from my messages.properties file. I have a form backing object where a field is an Integer. If I submit a string for that field I get: Failed to...
Jeremy
1

votes
1

answer
10

Views

How to validate an empty checkbox and display message via AJAX using CodeIgniter form validation library?

Displaying form error message when checkbox is not checked using CodeIgniter form validation library. Currently, form error message is displayed only when checkbox is checked. Here is AJAX call: $('#add_user').on('submit', function(e) { e.preventDefault(); $.ajax({ url : $(this).attr('action'), meth...
Boba_Fett
1

votes
0

answer
223

Views

AngularJS - Validate when ng-model value not in Select options

I have a situation where the ng-model value may sometimes not be present in the ng-options list of a Select dropdown (ID of a user that is no longer with the company saved in a record, for example). AngularJS's behavior is that it adds an empty option to the dropdown, but does not mark it as Invali...
cheluto2
1

votes
0

answer
244

Views

python error : 'Too many indices for array' using cross_val_score from sklearn

I tried to compute a simple cross_val_score with a Logistic regression, but I don't understand why I get an error : 'Too many indices for array' About the data frame, there are 11 input variables, all of them with dtype float64. There are 2 output variable, quality (int) and cat_quality (string) (wh...
Régis Darmon
1

votes
0

answer
278

Views

How to remove annotations of a variable in a child class

Let us say that we have a class from API which has some fields, of which some are made mandatory using @NotNull annotation, like below: class SomeAPIClass { private String field1; private String field2; @NotNull public String getField1() { return field1; } public String getField2() { return field2;...
Rupesh
1

votes
1

answer
134

Views

Angular dynamically check and update validators

I need to dynamically add a validator to an angular form control from a directive. Simplified: @Directive({ selector: 'my-directive' }) export class MyDirective implements AfterViewInit { @Input() myDirective: boolean; control: AbstractControl; constructor(private form: NgForm, private el: ElementR...
Zlatko
1

votes
0

answer
36

Views

how to validate my login id which might be phone or email using Jquery validation

for my login screen, User can login by using his email or phone number. Here i am using jquery validation plugin. Below is my code : $('.login-form').validate({ errorElement: 'span', //default input error message container errorClass: 'help-block', // default input error message class focusInvalid:...

View additional questions