I wrote the code to learn text input devices. However, this is the error i receive:
ReferenceError processForm is not defined
Can someone please help me fix the code ? The code is as follows:
<body>
<h1>Text Input Devices</h1>
<form action = "">
<fieldset>
<label> Normal text field</label>
<input type = "text" id = "txtNormal" />
<label>Password field</label>
<input type="password" id ="pwd" />
<label>Hidden</label>
<input type ="hidden" id = "hidden" value = "I can't tell you it is hidden" />
<textarea id = "txtArea" rows = "10" cols = "40>"> This is big text area and it can hold a lot of text</textarea>
<button type = "button" onclick="processForm()">Click me</button>
</fieldset>
</form>
</body>
<script type ="text/javascript">
function processForm() {
//Dohvati polja formulara
var txtNormal = document.getElementById("txtNormal");
var pwd = document.getElementById("pwd");
var hidden = document.getElementById("hidden");
var txtArea = document.getElementById("txtArea");
// Spakuj u varijablu vrijednosti formulara
var normal = txtNormal.value;
var password = pwd.value;
var secret = hidden.value;
var bigText = txtArea.value;
//Create output
var result = ""
result += "<dl> \n";
result += "<dt>normal<\/dt> \n";
result += "<dd> + normal + <\/dd> \n";
result += "\n";
result += "<dt>password<\/dt> \n";
result += "<dd>" + password + "<\/dd> \n";
result += "\n";
result += "<dt>secret<\/dt> \n";
result += "<dd>" +secret + "<\/dt> \n";
result += "\n";
result += "<dt>big text <\/dt> \n";
result += "<dd>" +bigText + "<\/dt> \n";
result += "<\/dl> \n";
var output = document.getElementById("output");
output.innerHTML = result;
} //End function
</script>