﻿@model SFA.DAS.EmployerUsers.Web.Models.AccessCodeViewModel

<h1 class="heading-large">Register</h1>

@if (!Model.Valid)
{
    <div class="error" style="margin-bottom: 10px;">
        <p class="error-message">
            Invalid Code
        </p>
    </div>
}

<form method="post">
    <fieldset>
        <legend class="visuallyhidden">Access code for user registration</legend>

        <div class="form-group">
            <label class="form-label" for="AccessCode">Access Code</label>
            <input class="form-control" id="AccessCode" name="AccessCode">
        </div>
    </fieldset>
    <button type="submit" class="button">Activate Account</button>
</form>
﻿@model SFA.DAS.EmployerUsers.Web.Models.AccessCodeViewModel

@{
    var invalidAttributes = Model.Valid ? "aria-invalid=\"true\" aria-labeledby=\"invalidMessage\"" : "";
}


<h1 class="heading-large">Register</h1>

@if (!Model.Valid)
{
    <div id="invalidMessage" class="error" style="margin-bottom: 10px;">
        <p class="error-message">
            Invalid Code
        </p>
    </div>
}

<form method="post">
    <fieldset>
        <legend class="visuallyhidden">Access code for user registration</legend>

        <div class="form-group">
            <label class="form-label" for="AccessCode">Access Code</label>
            <input @invalidAttributes autofocus="autofocus" aria-required="true" class="form-control" id="AccessCode" name="AccessCode">
        </div>
    </fieldset>
    <button type="submit" class="button">Activate Account</button>
</form>
Add autofocus to AccessCode entry so invalid entry will force focus onto the input field
Add autofocus to AccessCode entry so invalid entry will force focus onto the input field
