JS Sound Alert for Data Entry

  • Last update:  2021-01-06
  • I. Overview

    1.1 Problem description

    When filling the form, if the content being entered does not match the actual situation, a warning can be issued through prompts. Simple prompts may be ignored, and here is a way to warn by sound.

    As shown in the example below, if the quantity is more than 100, you can hear the alarm.

    1.gif


    1.2 Implementation ideas

    Add conditional formatting to limit the value to be filled, and call the alarm sound through the Loading End event.

    II. Example

    2.1 Template preparation

    You can create a template yourself, or download the attached template for testing.

    2.2 Conditional Formatting

    1) Add a New Value condition formatting in cell L3, as shown in the figure below:

    1.png

    The new value is a string: <embed width="0" height="0" src="/webroot/help/5196.mp3" autostart="true" loop="true" hidden="true"></embed>

    The formula condition is: J3> 100

    Note: where src is the storage path of the warning sound, you need to save the warning sound file in %FR_HOME%\webapps\webroot\help in advance. Currently, this method does not support referencing online addresses.


    Click to download the warning sound file:

    5196.mp3


    2) Set cell L3 to Display by HTML.

    2.png

     

    2.3 Template web attributes

    Choose Template> Web Attributes. In this example, a form is used for setting, so select Data Entry Settings and add a Loading End event, as shown in the following figure:

    3.png

    The JavaScript code is:

    setInterval("self.location.reload();",36000);

     

    2.4 Preview effect

    Save the template and choose Data Entry Preview. You can experience the warning sound effect locally by yourself.

    Note: Mobile terminal is not supported.

    III. Completed Template

    Attachment List


    Theme: Data Entry
    • 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