One-Time-Only Data Entry of Widgets by JS

  • Last update:December 22, 2025
  • Overview

    Description

    During data entry, you want to implement the following effects: Values of certain fields, such as grades or passwords, can only be entered once. Once entered, the values cannot be modified. How can this be achieved?

    1.1 问题描述.png

    Implementation Method

    You can add an After Editing event to the widget to enable one-time-only data entry of the widget.

    Example

    Data Preparation

    Create a built-in dataset, and design it as shown in the following figure.

    2.1 数据准备.png

    Table Design

    Design a simple table: Insert text widgets to cells C2 and C3, and a drop-down widget to cell C4, as shown in the following figure.

    2.2 表格设计.png

    Data Dictionary Setting

    Select cell C4 and bind a data dictionary to the drop-down box widget, as shown in the following figure.

    2.3 设置数据字典.png

    JS Event Setting

    Select cell C4 and add an After Editing event, as shown in the following figure.

    2.4 设置 JS 事件.png

    The JavaScript (JS) code for the event is as follows:

    if(this.getValue()!="")//Obtain the current widget value, and determine whether the value equals an empty string.

        {this.setEnable(false)}//If not, the value cannot be modified.

     else

        {this.setEnable(true)}//If so, the value can be modified.

    Effect Preview

    (1) PC

    Save the template and click Data Entry Preview. The following figure shows the effect.

    PC端.png

    iconNote:
    You have not set the data entry attributes for the template, so the entered data cannot be submitted to the database normally. This example is only for frontend demonstration purposes.

    (2) Mobile terminal

    手机.jpg

    Template Download

    Download the template by clicking One-Time-Only Data Entry of Widgets by JS.cpt.

     


    Attachment List


    Theme: Data Entry
    Already the First
    Already the Last
    • 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