This topic is locked

Checkboxes

1/20/2008 9:32:42 PM
ASPRunnerPro General questions
M
MikeGinMN author

is it possible to see if 2 checkboxes are checked and if they are display a popup saying you can only choose one or the other?

M
MikeGinMN author 1/21/2008

I've tried checking to see if the 2 fields have any length and if they both do I display the message. But if I uncheck either one or the other or both of them, when I click on save I get the message saying I can only check one or the other
Here is my code
' Parameters:

' dict - Scripting.Dictionary object.

' Each field on the Add form is represented as a 'Field name'-'Field value' pair

if (Len(dict("Unified")) > 0) and (Len(dict("Unified")) > 0) then

BeforeAdd = False

'** Display a message on the Web page ****

Response.Write "<script>alert('Individual can be registered as a Coach or as a Unified Partner')</script>)"

Else

BeforeAdd = True

End if

' set BeforeAdd to True if you like to proceed with adding new record

' set it to False otherwise

M
MikeGinMN author 1/22/2008

I actually change code to this and it works
' Parameters:

' dict - Scripting.Dictionary object.

' Each field on the Add form is represented as a 'Field name'-'Field value' pair

Count = 0

if dict("Unified") = 1 and dict("Coach") = 1 then

BeforeAdd = False

'** Display a message on the Web page ****

Response.Write "<script>alert('Individual can be registered as a Coach or as a Unified Partner')</script>"

Else

BeforeAdd = True

End if

' set BeforeAdd to True if you like to proceed with adding new record

' set it to False otherwise
Thanks for the help