Empty input handling
This commit is contained in:
14
index.html
14
index.html
@@ -30,15 +30,19 @@
|
|||||||
<a href="https://registrar.utexas.edu/schedules">official course name</a>
|
<a href="https://registrar.utexas.edu/schedules">official course name</a>
|
||||||
as possible
|
as possible
|
||||||
</p>
|
</p>
|
||||||
|
<form action="">
|
||||||
|
|
||||||
<!-- Data is separated into course number, course prefi;x, and course name-->
|
<!-- Data is separated into course number, course prefi;x, and course name-->
|
||||||
<label for="courseField">Course Field (Ex: "MUS"):</label>
|
<label for="courseField">Course Field (Ex: "MUS"):</label>
|
||||||
<input type="text" id="courseField" name="fname"><br><br>
|
<input type="text" id="courseField" name="fname" required><br><br>
|
||||||
<label for="courseNum">Course Number (Ex: "307"):</label>
|
<!-- <label for="courseNum">Course Number (Ex: "307"):</label>
|
||||||
<input type="text" id="courseNum" name="fname"><br><br>
|
<input type="text" id="courseNum" name="fname"><br><br> -->
|
||||||
<label for="courseName">Course Name (Ex: "Jazz Appreciation"):</label>
|
<label for="courseName">Course Name (Ex: "Jazz Appreciation"):</label>
|
||||||
<input type="text" id="courseName" name="fname"><br><br>
|
<input type="text" id="courseName" name="fname" required><br><br>
|
||||||
<label for="courseInstructor">Instructor (Optional)</label>
|
<label for="courseInstructor">Instructor (Optional)</label>
|
||||||
<input type="text" id="courseInstructor" name="fname"><br><br>
|
<input type="text" id="courseInstructor" name="fname"><br><br>
|
||||||
|
<button type="submit" id="subBut">Submit</button><br><br>
|
||||||
|
|
||||||
<form>
|
<form>
|
||||||
<label for="dropdown">Semester (work in progress):</label>
|
<label for="dropdown">Semester (work in progress):</label>
|
||||||
<select id="dropdown" name="dropdown">
|
<select id="dropdown" name="dropdown">
|
||||||
@@ -48,7 +52,7 @@
|
|||||||
</select>
|
</select>
|
||||||
<br><br>
|
<br><br>
|
||||||
</form>
|
</form>
|
||||||
<button type="submit" id="subBut">Submit</button>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<script src='main.js'></script>
|
<script src='main.js'></script>
|
||||||
</body>
|
</body>
|
||||||
|
|||||||
9
main.js
9
main.js
@@ -11,12 +11,11 @@ function parseName() {
|
|||||||
alert("Invalid Department");
|
alert("Invalid Department");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(className == '' && department == '') {
|
// if(className == '' && department == '') {
|
||||||
alert("At least fill out the form...");
|
// alert("At least fill out the form...");
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
if(className == '' || department == '') {
|
if(className == '' || department == '') {
|
||||||
alert("Missing something?");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.log(department, 0, className);
|
console.log(department, 0, className);
|
||||||
|
|||||||
Reference in New Issue
Block a user