Team 4 (Mother Forum) Pincode,City validation
Specific Folder FTP Upload / ftp-deploy (push) Successful in 1m46s
Details
Specific Folder FTP Upload / ftp-deploy (push) Successful in 1m46s
Details
This commit is contained in:
parent
195a9e9680
commit
001c72d68e
|
|
@ -50,16 +50,16 @@
|
|||
|
||||
|
||||
$submittedMonths = [];
|
||||
if (!empty($submissions)) {
|
||||
foreach ($submissions as $sub) {
|
||||
if (isset($sub->formdata->month) && !empty($sub->formdata->month)) {
|
||||
$submittedMonths[] = trim($sub->formdata->month);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!empty($submissions)) {
|
||||
foreach ($submissions as $sub) {
|
||||
if (isset($sub->formdata->month) && !empty($sub->formdata->month)) {
|
||||
$submittedMonths[] = trim($sub->formdata->month);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$isEditMode = !empty($id);
|
||||
|
||||
$isEditMode = !empty($id);
|
||||
|
||||
@endphp
|
||||
|
||||
|
|
@ -124,40 +124,40 @@
|
|||
@break --}}
|
||||
|
||||
@case('dropdown')
|
||||
<select class="form-control" id="field-{{ $question->code }}" name="{{ $question->code }}" data-initial-value="{{ isset($question->value) ? $question->value : '' }}" {{ $question->required == 'yes' ? 'required' : '' }}>
|
||||
<option value=""> -- Select -- </option>
|
||||
@foreach ($question->options as $option)
|
||||
@php
|
||||
$isSubmitted = ($question->code == 'month' && in_array(trim($option->value), $submittedMonths));
|
||||
$isSelected = (isset($question->value) && $question->value == $option->value);
|
||||
|
||||
$isDisabled = ($isSubmitted && (!$isEditMode || !$isSelected));
|
||||
@endphp
|
||||
<select class="form-control" id="field-{{ $question->code }}" name="{{ $question->code }}" data-initial-value="{{ isset($question->value) ? $question->value : '' }}" {{ $question->required == 'yes' ? 'required' : '' }}>
|
||||
<option value=""> -- Select -- </option>
|
||||
@foreach ($question->options as $option)
|
||||
@php
|
||||
$isSubmitted = ($question->code == 'month' && in_array(trim($option->value), $submittedMonths));
|
||||
$isSelected = (isset($question->value) && $question->value == $option->value);
|
||||
|
||||
$isDisabled = ($isSubmitted && (!$isEditMode || !$isSelected));
|
||||
@endphp
|
||||
|
||||
@if($question->code == 'contact_id' && isset($option->contact->type) && $option->contact->type == 'doctor')
|
||||
<option value="{{ $option->value }}"
|
||||
@if($isSelected) selected @endif
|
||||
msl_code="{{ $option->contact->msl_code ?? '' }}"
|
||||
speciality="{{ $option->contact->speciality ?? '' }}">
|
||||
{{ $option->display }}
|
||||
</option>
|
||||
@elseif($question->code == 'month')
|
||||
<option value="{{ $option->value }}"
|
||||
{{ $isSelected ? 'selected' : '' }}
|
||||
{{ $isDisabled ? 'disabled' : '' }}>
|
||||
{{ $option->display }} {{ $isDisabled ? '(Already Submitted)' : '' }}
|
||||
</option>
|
||||
@else
|
||||
<option value="{{ $option->value }}"
|
||||
{{ $isSelected ? 'selected' : '' }}
|
||||
{{ $question->code == 'contact_id' ? 'pcode=' . ($option->contact->pcode ?? '') : '' }}
|
||||
{{ $question->code == 'contact_id' ? 'speciality=' . ($option->contact->speciality ?? '') : '' }}>
|
||||
{{ $option->display }}
|
||||
</option>
|
||||
@endif
|
||||
@endforeach
|
||||
</select>
|
||||
@break
|
||||
@if($question->code == 'contact_id' && isset($option->contact->type) && $option->contact->type == 'doctor')
|
||||
<option value="{{ $option->value }}"
|
||||
@if($isSelected) selected @endif
|
||||
msl_code="{{ $option->contact->msl_code ?? '' }}"
|
||||
speciality="{{ $option->contact->speciality ?? '' }}">
|
||||
{{ $option->display }}
|
||||
</option>
|
||||
@elseif($question->code == 'month')
|
||||
<option value="{{ $option->value }}"
|
||||
{{ $isSelected ? 'selected' : '' }}
|
||||
{{ $isDisabled ? 'disabled' : '' }}>
|
||||
{{ $option->display }} {{ $isDisabled ? '(Already Submitted)' : '' }}
|
||||
</option>
|
||||
@else
|
||||
<option value="{{ $option->value }}"
|
||||
{{ $isSelected ? 'selected' : '' }}
|
||||
{{ $question->code == 'contact_id' ? 'pcode=' . ($option->contact->pcode ?? '') : '' }}
|
||||
{{ $question->code == 'contact_id' ? 'speciality=' . ($option->contact->speciality ?? '') : '' }}>
|
||||
{{ $option->display }}
|
||||
</option>
|
||||
@endif
|
||||
@endforeach
|
||||
</select>
|
||||
@break
|
||||
|
||||
@case('checkbox')
|
||||
@foreach($question->options as $option)
|
||||
|
|
@ -383,6 +383,58 @@
|
|||
}
|
||||
});
|
||||
|
||||
|
||||
$("[id^='field-city_']").on('input keyup paste', function() {
|
||||
|
||||
this.value = this.value.replace(/[^a-zA-Z\s]/g, '');
|
||||
});
|
||||
|
||||
|
||||
$("[id^='field-city_']").on('keypress', function(e) {
|
||||
var regex = new RegExp("^[a-zA-Z\\s]+$");
|
||||
var str = String.fromCharCode(!e.charCode ? e.which : e.charCode);
|
||||
if (!regex.test(str)) {
|
||||
e.preventDefault();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
$("[id^='field-pin_code_']").on('input keyup paste', function() {
|
||||
var val = this.value;
|
||||
|
||||
|
||||
val = val.replace(/\D/g, '');
|
||||
|
||||
|
||||
val = val.replace(/^0+/, '');
|
||||
|
||||
|
||||
if (val.length > 6) {
|
||||
val = val.substring(0, 6);
|
||||
}
|
||||
|
||||
this.value = val;
|
||||
});
|
||||
|
||||
|
||||
$("[id^='field-pin_code_']").on('keypress', function(e) {
|
||||
var char = String.fromCharCode(e.which || e.keyCode);
|
||||
|
||||
|
||||
if (!/^\d$/.test(char)) {
|
||||
e.preventDefault();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (this.value.length === 0 && char === '0') {
|
||||
e.preventDefault();
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
$("#pageloader").fadeOut();
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue