[ad_1]
Asked
Viewed
6 times
There are lots of similar questions to mine but there all stupid questions about not using the syntax correctly, im pretty sure everything is normal but I still get a error
<body><p style="font-size:140%;">Address :</p><input required="" minlength="3" maxlength="30" style="font-size:120%;" id="Address" class="textbox" placeholder="Type...">
<script
src="https://code.jquery.com/jquery-3.6.0.min.js"
integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4="
crossorigin="anonymous"></script>
<p style="font-size:140%;">Name :</p><input required="" minlength="3" maxlength="25" style="font-size:120%;" id="Name" class="textbox" placeholder="Type...">
<p style="font-size:140%;">Email :</p><input required="" minlength="10" type="email" style="font-size:120%;" id="Email" class="textbox" placeholder="Type..."></input>
<p style="font-size:140%;">Treat :</p>
<h2 id="Error" style="left: 50%;top: 80%;position:absolute;width: max-content;">Please Fill Out All Fields!</h2>
<select style="font-size: 140%;" name="treat" onchange="getTreat(this)" id="Treat" class="textbox" form-control="" form-group="">
<option style="font-size:140%;" disabled selected hidden>Pick Treat...</option>
<option style="font-size:140%;" value="Brownie">Brownie</option>
<option style="font-size:140%;" value="Chocolate Chip Cookie">Chocolate Chip Cookie</option>
<option style="font-size:140%" value="Pecan Cookie">Pecan Cookie</option>
</select>
<p style="font-size:140%;">Dozen/Half Dozen :</p><select required="" minlength="3" maxlength="10" style="font-size:140%" id="Dozen" class="textbox">
<option style="font-size:140%;" disabled selected hidden>Dozen/Half Dozen</option>
<option style="font-size:140%;" value="Half Dozen">Half Dozen</option>
<option style="font-size:140%;" value="Dozen">Dozen</option>
</select>
<button class="button" style="color:#fff;position:relative; left:30%; top: -20%; bottom:0%;" onclick="check()">Submit</button>
<script>
function check() {
var address = document.getElementById('Address').value
var name = document.getElementById('Name')
var email = document.getElementById('Email')
var treat = document.getElementById('Treat')
var dozen = document.getElementById('Dozen')
if (email.value == '' || name.value == '' || dozen.value == 'Dozen/Half Dozen' || treat.value == 'Pick Treat...' || address.value == '') {
alert('detected')
}
</script>
penguinpowers is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
default
[ad_2]