Customer Registration Form Issues
December 29, 2024 ยท AI Conversations
$content_id = '8';
$getMetaDetails = getMetaDetails($content_id,getLocaleIdFront());
$topContents = getTopContents($content_id,getLocaleIdFront());
@endphp
@extends('frontend.layouts.app')
@section('title', 'Customer Registration')
@section('content')
@php echo $topContents; @endphp
@if ($errors->any())
@foreach ($errors->all() as $error)
{{ $error }}
@endforeach
@endif
@if (session()->has('message.level'))
{!! session('message.content') !!}
@endif
@csrf
{{ __('Company') }} *
{{ __('Please, enter company name *!') }}
{{ __('Title') }} *
{{__('Title')}}
@foreach ($salutations as $salutation)
title ? 'selected' : '' }}>{{$salutation->title}}
@endforeach
{{ __('Please enter a title!') }}
{{ __('First Name') }} *
{{ __('Please enter a first name.') }}
{{ __('Last Name') }} *
{{ __('Please enter a last name.') }}
{{ __('Address 1') }} *
{{ __('Please enter an Address 1') }}
{{ __('Address 2') }}
{{ __('Please enter an Address 2') }}
{{ __('City') }} *
{{ __('Please enter a city') }}
{{ __('Zip Code') }} *
{{ __('Please enter a zip code') }}
{{ __('State') }}
{{ __('Please enter a state') }}
{{ __('Country') }} *
{{ __('Select') }}
@foreach ($countries as $country)
id=='82' || old('country_id') == $country->id ? 'selected=selected' : '' }}>
{{ $country->name }}
@endforeach
{{ __('Please select a country!') }}
{{ __('Language') }}
@foreach ($languages as $language)
id ? 'selected=selected' : '' }}>
{{ $language->lang_name }} ({{ $language->lang_code }})
@endforeach
{{ __('Please select a language!') }}
{{ __('Phone Number') }}
{{ __('Please enter a phone number') }}
{{ __('Email Address') }} *
{{ __('Please enter a valid Email address!') }}
{{–
{{ __('Password') }} *
{{ __('Please enter your password!') }}
{{ __('Confirm Password') }} *
{{ __('Entered Password is not matching! Try Again') }}
–}}
{{ __('Your privacy is important to us. Please read and agree.') }} *
{{ __('Yes, I understand and agree to the') }} {{ __('Terms & Conditions') }}, {{ __('User Agreement') }} {{ __('and') }} {{ __('Privacy Policy') }}.
{{ __('You must agree before submitting.') }}
{{ __('Reset') }}
{{ __('Sign up') }}
<script>
</script>
<script>
console.log('Script loaded'); // Confirm script is running
document.addEventListener('DOMContentLoaded', function () {
console.log('DOM fully loaded'); // Confirm DOM is ready
const form = document.getElementById('signupregForm');
console.log(form); // Should log the form element
if (form) {
alert("dsfdasf");
form.addEventListener('submit', function (event) {
event.preventDefault();
console.log('Form submission detected'); // Confirm event is triggered
});
} else {
console.error('Form not found!');
}
});
</script>
@endsection
Sweet alert working
### Observations and Recommendations:
1. **Alert not triggering as expected**:
– If the `alert("dsfdasf")` within the `DOMContentLoaded` callback is not showing, it means the script might not be loading, or there's an issue with your `DOMContentLoaded` listener.
#### Suggested Fix:
– Ensure the “ tag is