Struggling to discover a way to secretly log user information such as their username when a checkbox is selected. The goal is to capture this data without the user's knowledge. Here is the code:
This checkbox is a custom switch from MDB
<div>
<div class="switch">
<label>
Checked and Verified
<input type="checkbox" checked>
<span class="lever"></span>
</label>
</div>
Desired logging action when the checkbox is switched to true:
<input id="username" value="@User.Identity.Name" />
@Html.EditorFor(x => x.DateCreated)
Despite my searches, I have not been successful in finding a suitable @if statement or JavaScript code that functions as needed. Assistance is greatly appreciated.