Fix kiosk Continue button blocked by hidden required fields.
Deploy Ladill Frontdesk / deploy (push) Successful in 37s
Deploy Ladill Frontdesk / deploy (push) Successful in 37s
Use novalidate and explicit click handler so browser validation on later steps does not prevent advancing the multistep form. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -125,10 +125,10 @@
|
||||
<p class="mt-2 text-sm font-semibold text-slate-900" x-text="currentFormStepLabel"></p>
|
||||
</div>
|
||||
|
||||
<form @submit.prevent="isLastFormStep ? submitCheckIn() : nextFormStep()">
|
||||
<form novalidate @submit.prevent="isLastFormStep ? submitCheckIn() : nextFormStep()">
|
||||
{{-- Step 1: Identity --}}
|
||||
<div x-show="formStep === 1" class="space-y-4">
|
||||
<input type="text" x-model="form.full_name" required placeholder="Full name" class="w-full rounded-xl border-slate-200 px-4 py-4 text-lg">
|
||||
<input type="text" x-model="form.full_name" placeholder="Full name *" class="w-full rounded-xl border-slate-200 px-4 py-4 text-lg">
|
||||
<input type="text" x-model="form.company" placeholder="Company" class="w-full rounded-xl border-slate-200 px-4 py-4 text-lg">
|
||||
<input type="tel" x-model="form.phone" placeholder="Phone" class="w-full rounded-xl border-slate-200 px-4 py-4 text-lg">
|
||||
<input type="email" x-model="form.email" placeholder="Email" class="w-full rounded-xl border-slate-200 px-4 py-4 text-lg">
|
||||
@@ -151,16 +151,16 @@
|
||||
<div>
|
||||
<label class="mb-1 block text-sm font-medium text-slate-600" x-text="field.label"></label>
|
||||
<template x-if="field.type === 'textarea'">
|
||||
<textarea x-model="form.type_fields[field.name]" :required="field.required" rows="2" class="w-full rounded-xl border-slate-200 px-4 py-3 text-lg"></textarea>
|
||||
<textarea x-model="form.type_fields[field.name]" rows="2" class="w-full rounded-xl border-slate-200 px-4 py-3 text-lg"></textarea>
|
||||
</template>
|
||||
<template x-if="field.type === 'checkbox'">
|
||||
<label class="flex items-center gap-2 text-sm">
|
||||
<input type="checkbox" :checked="form.type_fields[field.name]" @change="form.type_fields[field.name] = $event.target.checked" :required="field.required" class="h-5 w-5 rounded">
|
||||
<input type="checkbox" :checked="form.type_fields[field.name]" @change="form.type_fields[field.name] = $event.target.checked" class="h-5 w-5 rounded">
|
||||
Yes
|
||||
</label>
|
||||
</template>
|
||||
<template x-if="field.type === 'date' || field.type === 'datetime-local' || field.type === 'text'">
|
||||
<input :type="field.type" x-model="form.type_fields[field.name]" :required="field.required" class="w-full rounded-xl border-slate-200 px-4 py-3 text-lg">
|
||||
<input :type="field.type" x-model="form.type_fields[field.name]" class="w-full rounded-xl border-slate-200 px-4 py-3 text-lg">
|
||||
</template>
|
||||
<template x-if="field.type === 'signature'">
|
||||
<canvas :x-ref="'sig_' + field.name" width="400" height="120" class="w-full rounded-xl border border-slate-200 bg-slate-50"
|
||||
@@ -190,13 +190,14 @@
|
||||
</template>
|
||||
|
||||
<label class="flex items-center gap-3 text-sm">
|
||||
<input type="checkbox" x-model="form.policies_accepted" required class="h-5 w-5 rounded">
|
||||
<input type="checkbox" x-model="form.policies_accepted" class="h-5 w-5 rounded">
|
||||
I have read and accept the visitor policies
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="mt-6">
|
||||
<button type="submit"
|
||||
<button type="button"
|
||||
@click="isLastFormStep ? submitCheckIn() : nextFormStep()"
|
||||
:disabled="loading"
|
||||
class="btn-primary w-full py-3 disabled:opacity-50">
|
||||
<span x-text="loading ? 'Submitting…' : (isLastFormStep ? 'Complete check-in' : 'Continue')"></span>
|
||||
|
||||
Reference in New Issue
Block a user