Skip to content

Commit

Permalink
Update scouting.html
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateo-Johnson authored May 12, 2024
1 parent 89b72b8 commit e940f7e
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions resources/scouting.html
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@
<body>

<form id="scoutingForm">
<!-- Page 1 -->
<fieldset class="form-page active">
<h2>Team Info</h2>
<label for="teamNumber">Team Number:</label>
Expand All @@ -154,7 +153,6 @@ <h2>Team Info</h2>
</div>
</fieldset>

<!-- Page 2 -->
<fieldset class="form-page">
<h2>Auto</h2>
<label><input type="checkbox" name="Auto Move"> Did they move in auto?</label>
Expand All @@ -170,7 +168,6 @@ <h2>Auto</h2>
</div>
</fieldset>

<!-- Page 3 -->
<fieldset class="form-page">
<h2>Teleop</h2>
<label for="notesScoredAmp">Amp Score: <span id="notesScoredAmpValue">0</span></label>
Expand All @@ -194,7 +191,6 @@ <h2>Teleop</h2>
</div>
</fieldset>

<!-- Page 4 -->
<fieldset class="form-page">
<h2>Issues</h2>
<label for="matchScore">Match Score:</label>
Expand Down Expand Up @@ -241,14 +237,14 @@ <h2>Issues</h2>
for (const checkbox of scoutingForm.querySelectorAll('input[type="checkbox"]')) {
formData.set(checkbox.name, checkbox.checked ? "Yes" : "No");
}
// Set text inputs to "N/A" if empty

const textInputs = scoutingForm.querySelectorAll('input[type="text"], textarea');
textInputs.forEach(input => {
if (input.value.trim() === '') {
input.value = 'N/A';
}
});
// Reset sliders

const sliders = document.querySelectorAll('input[type="range"]');
sliders.forEach(slider => {
slider.value = '0';
Expand All @@ -261,8 +257,8 @@ <h2>Issues</h2>
.then(response => {
if (response.ok) {
alert('Form submitted successfully!');
scoutingForm.reset(); // Reset form after successful submission
currentPage = 0; // Reset current page to the first page
scoutingForm.reset();
currentPage = 0;
formPages.forEach((page, index) => {
if (index === 0) {
page.classList.add('active');
Expand Down

0 comments on commit e940f7e

Please sign in to comment.