Skip to content

Commit

Permalink
Merge pull request #1365 from britneywwc/forms-payload
Browse files Browse the repository at this point in the history
Add is-required label to required fields
  • Loading branch information
britneywwc committed Sep 17, 2024
2 parents 52e8e52 + 9b10c2e commit fd85b9b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
18 changes: 9 additions & 9 deletions templates/data/_form-data-kafka.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,32 @@ <h3 class="p-heading--5">Tell us more about your Kafka use case</h3>
<h3 class="p-heading--5">How should we get in touch?</h3>
<ul class="p-list">
<li class="p-list__item">
<label for="firstName">First name:</label>
<label class="is-required" for="firstName">First name:</label>
<input required id="firstName" name="firstName" maxlength="255" type="text" required="required" />
</li>
<li class="p-list__item">
<label for="lastName">Last name:</label>
<label class="is-required" for="lastName">Last name:</label>
<input required id="lastName" name="lastName" maxlength="255" type="text" required="required" />
</li>
<li class="p-list__item">
<label for="company">Company name:</label>
<input required id="company" name="company" maxlength="255" type="text">
<label class="is-required" for="company">Company name:</label>
<input required id="company" name="company" maxlength="255" type="text" />
</li>
<li class="p-list__item">
<label for="title">Job title:</label>
<input required id="title" name="title" maxlength="255" type="text">
<label class="is-required" for="title">Job title:</label>
<input required id="title" name="title" maxlength="255" type="text" />
</li>
<li class="p-list__item">
<label for="email">Work email:</label>
<label class="is-required" for="email">Work email:</label>
<input required id="email" name="email" maxlength="255" type="email" pattern="^[^ ]+@[^ ]+\.[a-z]{2,26}$" required="required" />
</li>
<li class="p-list__item">
<label for="phone">Mobile/cell phone number:</label>
<label class="is-required" for="phone">Mobile/cell phone number:</label>
<input required id="phone" name="phone" maxlength="255" type="tel" required="required" />
</li>
<li class="p-list__item">
<label class="p-checkbox">
<input class="p-checkbox__input" value="yes" aria-labelledby="canonicalUpdatesOptIn" name="canonicalUpdatesOptIn" type="checkbox">
<input class="p-checkbox__input" value="yes" aria-labelledby="canonicalUpdatesOptIn" name="canonicalUpdatesOptIn" type="checkbox" />
<span class="p-checkbox__label" id="canonicalUpdatesOptIn">I agree to receive information about Canonical's products and services.</span>
</label>
</li>
Expand Down
24 changes: 12 additions & 12 deletions templates/data/_form-data-mongodb.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,28 @@ <h2 class="p-heading--1">Talk to our MongoDB experts</h2>
<div class="row">
<div class="col-6">
<div class="p-section--shallow">
<label for="Comments_from_lead__c">Tell us more about your MongoDB use case</h2>
<label for="Comments_from_lead__c">Tell us more about your MongoDB use case</label>
<textarea id="Comments_from_lead__c" name="Comments_from_lead__c" aria-label="Anything you'd like to communicate about your needs or interests?" rows="3" placeholder="Anything you'd like to communicate about your needs or interests?"></textarea>
</div>
<hr>
<hr />
<h3 class="p-heading--5">How should we get in touch?</h3>
<div class="p-section--shallow">
<label for="firstName">First name:</label>
<label class="is-required" for="firstName">First name:</label>
<input required id="firstName" name="firstName" maxlength="255" type="text" required="required" />
<label for="lastName">Last name:</label>
<label class="is-required" for="lastName">Last name:</label>
<input required id="lastName" name="lastName" maxlength="255" type="text" required="required" />
<label for="company">Company name:</label>
<input required id="company" name="company" maxlength="255" type="text">
<label for="title">Job title:</label>
<input data-testid="form-jobTitle" required id="title" name="title" maxlength="255" type="text">
<label for="email">Work email:</label>
<label class="is-required" for="company">Company name:</label>
<input required id="company" name="company" maxlength="255" type="text" />
<label class="is-required" for="title">Job title:</label>
<input data-testid="form-jobTitle" required id="title" name="title" maxlength="255" type="text" />
<label class="is-required" for="email">Work email:</label>
<input required id="email" name="email" maxlength="255" type="email" pattern="^[^ ]+@[^ ]+\.[a-z]{2,26}$" required="required" />
<label for="phone">Phone number:</label>
<label class="is-required" for="phone">Phone number:</label>
<input required id="phone" name="phone" maxlength="255" type="tel" required="required" />
</div>
<div class="p-section--shallow">
<label class="p-checkbox">
<input class="p-checkbox__input" value="yes" aria-labelledby="canonicalUpdatesOptIn" name="canonicalUpdatesOptIn" type="checkbox">
<input class="p-checkbox__input" value="yes" aria-labelledby="canonicalUpdatesOptIn" name="canonicalUpdatesOptIn" type="checkbox" />
<span class="p-checkbox__label" id="canonicalUpdatesOptIn">I agree to receive information about Canonical's products and services.</span>
</label>
<p>By submitting this form, I confirm that I have read and agree to Canonical's <a href="https://ubuntu.com/legal/terms-and-policies/privacy-policy" target="_blank">Privacy Policy</a>.</p>
Expand Down Expand Up @@ -61,7 +61,7 @@ <h3 class="p-heading--5">How should we get in touch?</h3>
<input type="hidden" aria-hidden="true" aria-label="hidden field" name="productContext" id="product-context" value="{{ product }}" />
</div>

<hr class="is-fixed-width">
<hr class="is-fixed-width" />
<div class="pagination">
<button type="submit" class="pagination__link--next p-button--positive" aria-label="Submit">Let's discuss</button>
</div>
Expand Down

0 comments on commit fd85b9b

Please sign in to comment.