Hi,
This is a function where user inputs modules results, press button and text area has to display when the student has to repeat a sit exam, (if pass all exam are successful, it won’t display message)
My problem is this: text area only display ONE failed result, for instance, if the student fail in more than one module, it will only display ONE, instead of all of them.
I don’t have Errors (I use firebug, Firefox).
Thanks. ?
[code=html] function exam()
{
var programming = parseInt(document.getElementById(“prog”).value, 10),
networking = parseInt(document.getElementById(“net”).value, 10),
webDevelop = parseInt(document.getElementById(“web”).value, 10),
database = parseInt(document.getElementById(“data”).value, 10);
document.getElementById(“submit1”).value = programming;
document.getElementById(“submit1”).value = networking;
document.getElementById(“submit1”).value = webDevelop;
document.getElementById(“submit1”).value = database;
if ( programming < 40 )
{
document.getElementById(“letter”).value = “You must to sit a repeat exam in Programming.”;
}
if ( networking < 40 )
{
document.getElementById(“letter”).value = “You must to sit a repeat exam in Networking”;
}
if ( webDevelop < 40 )
{
document.getElementById(“letter”).value = “You must to sit a repeat exam in Web Development”;
}
if ( database < 40 )
{
document.getElementById(“letter”).value = “You must to sit a repeat exam in Database”;
return;
}
}
</script>
[code=html]
<form action = “” name = “calculation”>
Result
<textarea rows = “3” cols=”40″ readonly=”readonly” id = “letter”></textarea>
<input type = “button” onclick = “exam();” id=”submit1″ value = “Result” />
</form>