Reputation: 11
How to solve the object required "checkMultiple" error. any idea how to disable the cmdButton7 when checkMultiple is checked and enable it when sum = 100. using VBSCRIPT.
Sub disableButton()
If checkMultiple.value = 1 Then
document.form1.cmdButton7.enabled = False
ElseIf sum = 100 Then
document.form1.cmdButton7.enabled = true
End If
End Sub
<input type="checkbox" name="checkMultiple" id="Multiple" onclick="disableButton">Multiple</input>
Upvotes: 1
Views: 1155
Reputation: 4017
Try qualifying it more explicitly like this for example:
Sub disableButton()
If document.form1.checkMultiple.value = 1 Then
document.form1.cmdButton7.enabled = False
ElseIf sum = 100 Then
document.form1.cmdButton7.enabled = true
End If
End Sub
<input type="checkbox" name="checkMultiple" id="Multiple"
onclick="disableButton">Multiple</input>
Upvotes: 0
Reputation: 161831
You didn't even bother to tell us if this is ASP.NET or Classic ASP, or what.
But I'd guess you need to use the ID instead of the name. Try calling it "Multiple" instead of "checkMultiple".
Upvotes: 1