Web Science/Part1: Foundations of the web/Dynamic Web Content/Client side JavaScript
Client side JavaScript
- understand how javascript was supposed to support people to fill out web forms
- understand the issues and disadvantages that arise with javascript
index.html
<html>
<head><title>Registration Form</title></head>
<body>
<script>
function validator(){
var name = document.getElementById("userinput").value;
if( name.length<3){
document.getElementById("warning").innerHTML = "User name is too short. Please enter at least 3 characters.";
}
}
</script>
<h1>Registration Form for the Web Science MOOC</h1>
<form action="servlet" method="POST">
<label for="userinput">Enter User:</label>
<input name="username" id="userinput" type ="text" onchange="validator()"/><span id="warning" style="color:red"></span>
<br>
<label for="emailinput">Enter email</label>
<input name="email" id="emailinput" type ="text" />
<br>
<input name="submit" id="submitbutton" type="submit" value="register"/>
</form>
</body>
</html>
no further reading defined
You can define further reading here.
In general you can use the edit button in the upper right corner of a section to edit its content.
In general you can use the edit button in the upper right corner of a section to edit its content.