/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] Textarea doesn’t show complete answer.

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]

[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> [/code]

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@PadonakApr 02.2012 — document.getElementById("letter").value [B]+[/B]= 'some sht';
Copy linkTweet thisAlerts:
@TheMLauthorApr 02.2012 — Thank you "Padonak"
×

Success!

Help @TheML spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...