devxlogo

Unselect All Radio Buttons in Visual InterDev

Unselect All Radio Buttons in Visual InterDev

When the Visual InterDev Scripting Object Model (SOM) creates an option group object (a set of radio buttons), it selects the first radio button when the page loads. You may not want to “influence” the user’s choice by allowing a default selection.

Although there’s no way to unset this default property using the design-time control, there is a method. You can use VID’s onbeforeserverevent, the firstentered property, and a little JavaScript to unselect all the buttons when the page first appears. The following code inserts a call to the clearopgp() function into the

tag only if this is the first time the page has appeared. This code snippet assumes that you have included the VID PageObject DTC in your ASP page.
 >

Note that the final > in the code snippet is important because it completes the

tag.
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist