About the app
Could this possibly be more vague?
Take a peek at our source code. We have created a form to send a message to our friend, Marco. Examine the HTML5 anatomy of the form.
Basic Form Anatomy:
For your convenience, we have listed the form and the associated JavaScript for the Clear button below: (You may have to scroll horizontally to see it all, sorry)
<form id="mpoloForm1" action="processMPolo1.php" method="GET">
<fieldset>
<legend>Compose a message:</legend>
<label>Message:</label>
<input type="text" id="msg" name="msg" value="Howdy, Marco!" size="35">
<input type="submit" id="submitBtn" name="submitBtn" value="Send Message">
<input type="button" id="clearBtn" name="clearBtn" value="Clear" onclick="clearField();">
</fieldset>
</form>
<script>
function clearField(){
var msgField = document.getElementById("msg");
msgField.value = "";
msgField.focus();
}
</script>
Go ahead, submit the form (Click the 'Send Message' button). We'll explain once we receive the message!
Note: If we are not careful, 'playful' users can do 'stuff' to input that might be unexpected. For example: what happens if you put this as input to Marco: Howdy, <span style="color:red">Marco</span>!
Try it and see! If you were succesful, you'll find that you influenced the nature of the input with an 'internal style.' This disturbing development is something we'll address in future stages.
01/17/19