JS Radio Button Group Always Keeps one Option Selected

  • Last update:  2020-12-23
  • I. Overview

    1.1 Requirement

    By clicking the Radio Button Group widget, an option will be selected. By clicking the widget again, the option will not be selected. This design is less humanized. So how to always have an option selected?

    Before setting:

    After setting:

     

     

    1.2 Solution

    Add an After Initialization event and a State Change event to the Radio Button Group widget with JavaScript.

    You will learn
    • Sample

      • Attributes of the Radio Button Group widget

      • Add JS events

      • Preview

    • Download the template

    II. Sample

    2.1 Attributes of the Radio Button Group widget

    1)Add a Radio Button Group widget and a Query widget to the parameter pane:

    2) The default value of the Radio Button Group widget is F. Set the Data Dictionary as Custom and set the Actual Value to F and M and the Display Value to Female and Male, as shown below:

     

     

    2.2 Add JS events

    1) Click on the button and add an After Initialization event:

    2)Click on the button and add a State Change event:

     

      

    2.3 Preview

    Save the template and click [Pagination Preview]. The preview effect is shown as below:

    7.gif 

    III. Download the template

    Attachment List


    Theme: Parameter
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy