Hi Everyone,
I am using widgets to create a form step 1 and step 2, put date picker to select with 7 days only from tomorrow onwards and validate the field is it with 7 days. After some days i try to view the order still validate the delivery date and does not allow me to the next step. how to resolve this?
15 Replies
It's hard to follow. Please add some code and maybe some screenshots
Sorry for the delay reply
$minDate = Carbon::now()->format('Y-m-d');
Forms\Components\DatePicker::make('deliveron')
->native(false)
->label('Deliver On')
->required()
->minDate($minDate)
->maxDate(Carbon::now()->addDays(7)->format('Y-m-d')),
I put in the order record creation. whenever view the order record prompt info.
whenever view the order record prompt info.So when you press "Next"? I think that's the indented behaviour. I think you should create a separate view for viewing the records
If Edit also same.
Sure makes sense. Forms have validation. Use a ViewAction if you don't want this or remove the validation
I need to restrict the users to place a order with in week or few days.
Then use a ViewAction for viewing.
what about edit? if comments the orders it would not allow right.
Then you should only validate on create?
Yes
You can use a Closure for the validation rule. Something like this could work. Same for minDate
Still not working.
I didn't validate the solution. Check whether context is actually
edit
I can't help you with that responseOK I will try thanks