form validation only for some parameters ??

Posted 1 year ago by belykia

hello everybody :

i made a form with 5 inputs , the same one for the last question , i have 5 names parameters for every input,name="ASNumber",name="choice",name="peeringDB",name="asset",name="Contact". i tried to make the form validation only for 2 name parameters: ASNumber,Contact using the following functions in the controller files "postcontroller.php" :

$request->validate([ 'ASNumber' => 'required|unique:posts|max:255', 'contact' => 'required|email', ]);

and tried to print it in the same blade.php file "home.blade.php"using :

@if ($errors->any())

@endif

but the problem , the all fields are concerned ,i need the validation only for the 2 parameters , how can i do ??

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.