skip to Main Content

Reactjs – How to validate Zod Object depending on value of parent object

I have a zod schema like this: export const memberSchema = z .object({ name: z.string().min(3), lastname: z.string().min(3), nationality: zCountries, birthdate: z.date(), email: z.string().email(), tutor: z .object({ name: z.string(), lastname: z.string(), documentType: zDocumentationType, documentValue: z.string(), email: z.string().email(), phone: z.string().regex(/^d{9}$/) }) }).refine((data)…

VIEW QUESTION

Laravel form validation max chars using 2 fields

i have a simple registeration form i use this validation for creating u new user $validator = Validator::make($request->all(), [ 'first_name' => ['required'], 'last_name' => ['required'], 'phone' => ['required', 'string', 'max:255'], 'email' => ['required', 'string', 'email', 'max:255', 'unique:users'], 'password' => ['required',…

VIEW QUESTION

Get array validation key in laravel

Im using laravel 8.83.27 public function messages() { return [ 'price_per_image.array' => 'Price must be an array', 'price_per_image.required' => 'Price per image field is required', 'price_per_image.*.required' => 'Price per image '.preg_replace('/^[a-zA-Z_]*./', '', ':key').' field required', 'price_per_image.*.numeric' => 'You have invalid…

VIEW QUESTION

Javascript – Comma separated mobile number Regex validation

I'm trying validation for mobile number(With country code) which is not working. Posting the validation criteria below: Valid Numbers: +18790912345 (Valid) +18790112345,+18790123409 (Valid) +1-2569890912345 (Valid) +1-2569890912345,+939890912098 (Valid) -19890123909 (Valid) Invalid Numbers: +1909890 (Invalid) 9800112345 (Invalid - without country code) +1…

VIEW QUESTION
Back To Top
Search