View Full Version : deactivating button

08-01-2006, 05:49 PM
help everyone...

have a problem with deactivating buttons. i wanted to create a js that would activate a second button if the first button is clicked.

the sample below would activate the button if the correct text input is given (though written in vbscript.. guess they are almost the same)

<INPUT name="edit1" size="50">
<SCRIPT type="text/vbscript">
Sub edit1_changed()
If edit1.value = "abc" Then
button1.enabled = True
button1.enabled = False
End If
End Sub

can anyone pls help me make a script in js replacing the text input to button so the second button would be activated...

your help would be greatly appreciated... thank you.

08-01-2006, 06:18 PM
this is a JavaScript forum

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">



<INPUT name="edit1" size="50" onblur="edit1_changed(this,'button1','abc');" >
<input type="button" id="button1" value="Test" onclick="alert('enabled');" />
<SCRIPT type="text/javascript">

function edit1_changed(obj,id,val){
var zxcobj=document.getElementById(id);
if (obj.value==val){