0
votes

I'm trying to implement a function that will disable the cmdButton7 when checkbox checkMultiple is checked. and enable it again when sum = 100 using vbscript , asp.net.

I tried the method below:

Sub disableButton()
If document.form1.Multiple.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>

But I get this error:
object required "disableButton"

2
"on" appears in that several places... doh! - user166390
possible duplicate of [how to solve object required error. ](stackoverflow.com/questions/3081655/…) - Helen

2 Answers

1
votes

Add a space between "Multiple" and onclick in your markup.

0
votes
<input type="checkbox" name="checkMultiple" id="Multiple" onclick="disableButton">Multiple</input>

For this error, the string "Multiple" and onclick attribute needs a space between them.