{{-- fonts & icons exactly like CI --}} {{-- original CSS kept as-is --}}
@csrf
@if (empty($message ?? null)) @php // prepare automation map collector $__FORM_AUTOMATION_MAP = []; @endphp @foreach ($FormContent ?? [] as $i => $field) @php // Prefer a stable DB id if available, otherwise use sanitized name $stableId = 'field'; $safeField = preg_replace('/[^A-Za-z0-9_\-]/', '_', $stableId); $basePrefix = 'form_' . ($FormId ?? '0') . '_' . $safeField . '_' . $i; // push minimal metadata; automation tests can expand via DOM if needed $__FORM_AUTOMATION_MAP[$i] = [ 'rowIndex' => $i, 'fieldName' => $field['name'] ?? null, 'stableId' => $stableId, 'prefix' => $basePrefix, 'type' => $field['type'] ?? null, ]; // end of automation map @endphp @php $requiredField = trans('form_lang.requiredField'); $checkAtleastOne = trans('form_lang.pleaseCheckAtleastOne'); $reqAttr = ($field['required'] ?? '') === 'required' ? 'required' : ''; @endphp

@switch($field["type"]) @case('textarea') {{ $requiredField }} @break @case('text') {{ $requiredField }} @break @case('checkbox-group') @foreach ($field['values'] ?? [] as $j => $v) @php $inputId = "{$basePrefix}_chk_{$j}"; @endphp
@if (isset($v['name']))
{{ $requiredField }}
@endif @endforeach {{ $checkAtleastOne }} @break @case('radiobutton-group')
@foreach ($field['values'] ?? [] as $j => $v) @php $inputId = "{$basePrefix}_rad_{$j}"; @endphp @endforeach
{{ $checkAtleastOne }} @break @default {{ trans('form_lang.dataNotAvailable') }} @endswitch
@endforeach @php // output the automation map as a single JSON object the tests can read. $jsonMap = json_encode($__FORM_AUTOMATION_MAP); @endphp @else {!! $message !!} @endif
{{-- Error Modal (kept 1:1 with CI) --}} {{-- JS (same order as CI) --}}