View Full Version : re-enabling

09-18-2002, 11:59 PM
after i disabled a <input type="button"> I want to re-enable it so it can be clicked again. I am disabling the button by doing this.

test() {
<input type="button" name="tes" onClick="test()">

09-19-2002, 12:27 AM
this should make the button toggle the input between enabled and disabled...

function not_test() {

I would not use 'test' as the function name - that is a built-in function in javascript
There was a few typos, forms[] not form[]
ALso I'm just realizing that you want to enable and disable the button that you actually click on to call the function... don't think this will work.

09-19-2002, 01:33 AM
Hi chrismiceli,
what condition do you want to reach that enables the button?

09-19-2002, 02:59 AM
here is my script i would assume the stuff in bold would make the disabled function become enabled but it doesn't.

<script language="javascript">
function stats() {
spd = prompt("Please enter your speed", "Enter it here");
function di() {
var ran_num = Math.round(5*Math.random()) + 1;
document.form1.res.value = ran_num;
if (document.form1.res.value > 3) {
var ran_num0 = Math.round(5*Math.random()) + 1;
document.form1.res0.value = ran_num0}
else document.form1.res0.value = "0";
function dmg(v1) {
var fh = v1;
document.form1.foehealth.value = fh - document.form1.res0.value
if (spd <= 0) {
document.form1.res.value = "";
document.form1.res0.value = "";
<body onLoad="stats()">
<form name="form1">
Enemy's Health:<br>
<input type="text" name="foehealth" size="12" value="500"><p>
<input type="text" name="res" size="2" value="">
Roll to see if you will hit.<br>
<input type="text" name="res0" size="2" value="">
You will deal this much damage.<br>
<input type="button" name="put" value="Roll Dice" onClick="di()"><p>
<input type="button" name="hit" value="Attack" onClick="dmg(document.form1.foehealth.value)">

09-20-2002, 12:26 AM
what it the aim of this script?

09-20-2002, 01:48 AM

I got it working thanx anyway though

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum