validationrules

Unwanted validation rule being applied on password reset

China☆狼群 提交于 2021-01-29 20:46:09
问题 I'm trying to use the password reset ability of Laravel's authentication. After running make:auth command, inside my ResetPasswordController, I have overridden rules function of Illuminate\Foundation\Auth\ResetsPasswords trait as the following: protected function rules() { return [ 'token' => 'required', 'email' => 'required|email', 'password' => 'required|confirmed|min:4', ]; } So, I am trying to change the minimum length value to 4. But when I try to reset my password, a rule of minimum of

Validation rules required_if with other condition (Laravel 5.4)

坚强是说给别人听的谎言 提交于 2020-03-18 04:48:22
问题 I got a problem with validation rules with nested conditions. class StoreRequest extends Request { public function authorize(){ return true; } public function rules(){ return [ 'type_id' => 'required|integer', 'external_id' => 'required_if:type_id,==,3|integer', ]; } } Indeed I want to : - check the external_id only if the type_id equal to 3 - and check if it's an integer. When I post my form, the rules works when I select a type_id equal to 3. But if I select another type_id, like 1 or 2,

simple way to add a custom validation rule to all textboxes

戏子无情 提交于 2020-01-16 13:21:12
问题 I'm having problems setting a custom validation rule for all my textboxes in a Page. I know how to set it for 1 single textbox: <TextBox Margin="79,118,79,121" Name="textBox1" Style="{Binding EmptyTextboxValidator, UpdateSourceTrigger=PropertyChanged}"> <TextBox.Text> <Binding Path="Text" UpdateSourceTrigger="PropertyChanged"> <Binding.ValidationRules> <validators:StringRangeValidationRule MinimumLength="1" ErrorMessage="Text is te kort" /> </Binding.ValidationRules> </Binding> </TextBox.Text

WPF DependencyProperty Validation Binding to the object property

左心房为你撑大大i 提交于 2020-01-03 03:25:55
问题 I am trying to create a validation rule for a given control (in this scenario, it is the TextBox). I am not able to obtain a successful Binding to the property of an object, although appropriate steps were taken: ValidationRule and DepedencyProperty are taken advantage of. Kindly find code below. A side note is that "Is Required" in the custom Validation class is always False, unless I explicitly set the value in the XAML (no Binding, as per "Is Ranged" parameter). Any tips and suggestions

Using WPF Validation rules and disabling a 'Save' button

自作多情 提交于 2019-12-27 17:37:10
问题 I have a page where a few textboxes cannot be empty before clicking a Save button. <TextBox... <TextBox.Text> <Binding Path ="LastName" UpdateSourceTrigger="PropertyChanged"> <Binding.ValidationRules> <local:StringRequiredValidationRule /> </Binding.ValidationRules> </Binding> </TextBox.Text> My rule works. I have a red border around my textbox until I enter a value. So now I want to add this validation rule to my other text boxes. Now, how do I disable the Save button until the page has no

Simple Validation Rule inside the Model

那年仲夏 提交于 2019-12-24 03:13:00
问题 I refered here Laravel 4.2 Validation Rules - Current Password Must Match DB Value Here is my Rule for Password Confirmation : public static $ruleschangepwd = array( 'OldPassword' => array( 'required'), // need to have my rule here 'NewPassword' => 'required|confirmed|alphaNum|min:5|max:10' ); But I am having my rules in the Model As i saw the below given custom rule in the question Validator::extend('hashmatch', function($attribute, $value, $parameters) { return Hash::check($value, Auth:

Multiple Validation Rules and Validation Templates in WPF

徘徊边缘 提交于 2019-12-22 10:00:08
问题 Does anyone have a tactic for dealing with multiple validation rules and templates for those validation rules. Example: I want to have two validation rules (required & data) I want either... One template that can change is display depending on which rule is fired or Two templates, which get displayed depending on which rule is fired 回答1: Ok, so I've figured out an approach that works and I was hoping to get feedback from anyone that might have an interest in this. ValidationRule: My

In Codeigniter, how to pass a third parameter to a callback (form validation)?

馋奶兔 提交于 2019-12-20 10:47:34
问题 I am currently using the Form Validation class (on Codeigniter) and setting rules. It works like this with two parameters (codeigniter.com/user_guide/libraries/form_validation.html): $this->form_validation->set_rules('username', 'Username', 'callback_test[abc]'); But what about a third parameter? And a fourth...? Is it possible? 回答1: It is not official but works Split the parameter by ',' $this->form_validation->set_rules('article_big_image','Gambar Besar','callback_check_picture[article_big

Validation Framework in .NET that can do edits between fields

醉酒当歌 提交于 2019-12-18 05:06:11
问题 From my experience many validation frameworks in .NET allow you to validate a single field at a time for doing things like ensuring a field is a postal code or email address for instance. I usually call these within-field edits. In my project we often have to do between-field-edits though. For instance, if you have a class like this: public class Range { public int Min { get; set; } public int Max { get; set; } } you might want to ensure that Max is greater than Min. You might also want to do

WPF validation - ValidatesOnTargetUpdated

☆樱花仙子☆ 提交于 2019-12-12 15:21:20
问题 I have a number of textboxes in a WPF app on which I have set up some validation. On load the app deserialises a class onto which the WPF window's controls are bound. I have a ValidationRule that (for example) tests that a file exists. If I don't set ValidatesOnTargetUpdated then the corresponding TextBox validates when I change the (bound) Text Property and I see the (default) red border appear and a Tooltip ( {Binding RelativeSource={x:Static RelativeSource.Self}, Path=(Validation.Errors)