In order to determine eligibility for posted files, I am working on creating a pop-up modal where users can enter their regional school code in a text or number field.
For example, if the code entered is 11002, the user should receive a recommended message, otherwise they will receive an apology message. Additionally, I want to include a button that allows users to enter a new code if the previous one was not accepted. All of this functionality should be integrated on the same page.
Currently, my code displays the result in a field, but I would like it to appear in a span as plain text instead.
<style>
#result {
width: 100%;
}
#btn1 {
float: right;
}
</style>
<script>
function locationlookup() {
var result = document.getElementById("areacode").value;
var schooling;
if (result == 11002) {
schooling = "Great! Your school is eligible for this course";
} else if (result == 11003) {
schooling = "Great! Your school is eligible for this course";
} else if (result == 11004) {
schooling = "Your school is eligible but you need good conduct certificate";
} else {
schooling = "Sorry. we currently do not serve in your entered location";
}
document.getElementById("result").value = schooling;
}
</script>
<table align="center">
<tr>
<th>School Area code: <input type="text" name="areacode" id="areacode" >
<button onclick="locationlookup()" id="btn1">Lookup</button>
</th>
</tr>
<tr>
<th>
<input type="text" name="result" id="result" readonly></th>
<!-- I wish to change the above field to a span so no limitations. but stuff don't
work for me -->
</tr>
</table>