PDA

View Full Version : plz help


chrismiceli
09-18-2002, 02:57 AM
plz help, it worked just fine then I changed one thing and it doesn't work, so it is something minor


<html>
<head>
<title>test</title>
<script language="javascript">
function di() {
var ran_num = Math.round(5*Math.random()) + 1;
var ran_num0 = Math.round(5*Math.random()) + 1;}
document.form1.res.value = ran_num;
document.form1.res0.value = ran_num0;
document.form1.put.disabled=true;
}
</script>
</head>
<body>
<form name="form0">
Enemy's Health:<br>
<input type="text" name="foehealth" value="500"><p>
</form>
<form name="form1">
<input type="text" name="res" size="2" value="">
&nbsp;&nbsp;&nbsp;&nbsp;
<input type="text" name="res0" size="2" value=""><br>
<input type="button" name="put" value="Roll Dice" onClick="di()"><p>
<input type="button" name="hit" value="Attack" onClick="jjj()">
<body>
</form>
</form>
</body>
</html>

umm
09-18-2002, 03:03 AM
Originally posted by chrismiceli
plz help, it worked just fine then I changed one thing and it doesn't work, so it is something minor


<html>
<head>
<title>test</title>
<script language="javascript">
function di() {
var ran_num = Math.round(5*Math.random()) + 1;
var ran_num0 = Math.round(5*Math.random()) + 1;}
document.form1.res.value = ran_num;
document.form1.res0.value = ran_num0;
document.form1.put.disabled=true;
}
</script>
</head>
<body>
<form name="form0">
Enemy's Health:<br>
<input type="text" name="foehealth" value="500"><p>
</form>
<form name="form1">
<input type="text" name="res" size="2" value="">
&nbsp;&nbsp;&nbsp;&nbsp;
<input type="text" name="res0" size="2" value=""><br>
<input type="button" name="put" value="Roll Dice" onClick="di()"><p>
<input type="button" name="hit" value="Attack" onClick="jjj()">
<body>
</form>
</form>
</body>
</html>

chrismiceli
09-18-2002, 03:33 AM
that didn't work, it is something else, but thanx anyway umm, you always seem to end up helping me.LOL

umm
09-18-2002, 03:45 AM
probably a silly question but you did remove the red-highlted brace didn't you?

umm
09-18-2002, 03:49 AM
what is it exactly that isn't working and what was it that you changed?

chrismiceli
09-18-2002, 03:56 AM
i did remove the bracket but when I click on the Roll dice button it says object expected, I just downloaded netscape for their better debugger of microsoft and they color code html in red, and javascript in blue, all javascript was in blue except the function di()

umm
09-18-2002, 03:59 AM
well it works in ie5. I only get the "object expected" when I click the"Attack" button, but thats because there is no jjj() function in the script.

chrismiceli
09-18-2002, 04:09 AM
i know there is no jjj() script, i meant to take it out when i posted it but forgot. I tested it just now and it works, I guess it just didn't like, lots of stuff on computers seem to do that. :) thanx a lot umm, you were very helpful.

umm
09-18-2002, 04:24 AM
lol, no problems.:)