Add separate first name and last name fields to application form
Fixes validation error when last name was missing because single name field was being split. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
816bc986e3
commit
0debf5b456
19
apply.html
19
apply.html
|
|
@ -372,9 +372,15 @@
|
|||
<div class="question-number">Question 1 of 13</div>
|
||||
<h2>Contact Information</h2>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="name">Name <span class="required">*</span></label>
|
||||
<input type="text" id="name" name="name" required placeholder="Your full name">
|
||||
<div class="form-group" style="display: grid; grid-template-columns: 1fr 1fr; gap: 1rem;">
|
||||
<div>
|
||||
<label for="first_name">First Name <span class="required">*</span></label>
|
||||
<input type="text" id="first_name" name="first_name" required placeholder="First name">
|
||||
</div>
|
||||
<div>
|
||||
<label for="last_name">Last Name <span class="required">*</span></label>
|
||||
<input type="text" id="last_name" name="last_name" required placeholder="Last name">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
|
|
@ -881,13 +887,10 @@
|
|||
|
||||
function collectFormData() {
|
||||
const form = document.getElementById('application-form');
|
||||
const nameParts = form.name.value.trim().split(' ');
|
||||
const firstName = nameParts[0] || '';
|
||||
const lastName = nameParts.slice(1).join(' ') || '';
|
||||
|
||||
return {
|
||||
first_name: firstName,
|
||||
last_name: lastName,
|
||||
first_name: form.first_name.value.trim(),
|
||||
last_name: form.last_name.value.trim(),
|
||||
email: form.email.value,
|
||||
social_links: form.social_media.value,
|
||||
contact_other: form.contact_other.value,
|
||||
|
|
|
|||
Loading…
Reference in New Issue