dedon
-
Posts
2 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Posts posted by dedon
-
-
i need a way to talley some things up using java.for example like a survey.just says there are 3 choiceschoose 1 and then on another button the admin can find the tallyive got a function buttonthen a box which asks for ur optionthen i dont no how to do the tallying partif any one can help ill be gr8ful
can some one please help with this problem
in JavaScript
Posted
the problem is that what ever i choose it allway say natwest and it always tally up natwest and not the ones u click on look at highlighted part below <html><HEAD><META httP-equiv="content-type" content="text/html;charset=iso 8859-1"/><TITLE>template</TITLE><script language = "javascript">var NatwestCount; var HalifaxCount; var HsbcCount; var AbbeyCount; NatwestCount = 0 HalifaxCount = 0 HsbcCount = 0 AbbeyCount = 0 function disp_ConfirmNatwest() { var Natwest=confirm("You Are Voting For Natwest, Is This Ok?") if (Natwest==true) { NatwestCount = NatwestCount + 1; } else { NatwestCount = NatwestCount + 0; } } function disp_ConfirmHsbc() { var Hsbc=confirm("You Are Voting For Hsbc, Is This Ok?") if (Hsbc==true) { HsbcCount = HsbcCount + 1; } else { HsbcCount = HsbcCount + 0; } } function disp_ConfirmHalifax() { var Halifax=confirm("You Are Voting For Halifax, Is This Ok?") if (Halifax==true) { HalifaxCount = HalifaxCount + 1; } else { HalifaxCount = HalifaxCount + 0; } } function disp_ConfirmAbbey() { var Abbey=confirm("You Are Voting For Abbey, Is This Ok?") if (Abbey==true) { AbbeyCount = AbbeyCount + 1; } else { AbbeyCount = AbbeyCount + 0; } } function disp_alert() { alert (' Total Votes For Each Bank ' + '\n' + ' Natwest = ' + NatwestCount + '\n' + ' Hsbc = ' + HsbcCount + '\n' + ' Halifax = ' + HalifaxCount + '\n' + ' Abbey = ' + AbbeyCount) } function password (form) { var pass = form.inputbox.value; if (pass == "banker") { disp_alert(); } else { alert (" You Have Entered The Wrong Password !!!" + '\n' + " Please Enter The Correct Password") } } </script></head><body><form><select> <option value ="0">Please Choose</option> <option value ="Natwest">Natwest</option> <option value ="Abbey">Abbey</option> <option value ="HSBC">HSBC</option></select><input type="button" value="SUBMIT" onclick="disp_ConfirmNatwest()", <BR> </form> <form name="passform" ACTION="" METHOD="GET">Password: <input type="password" NAME="inputbox" VALUE=""><P> <input type="button" NAME="button" Value="admin view data" onClick="password(this.form)"> </form></script></head><body></body></html>