Skip to content

inputAlert() Function Documentation – Merciglobal Cloud ERP

Merciglobal Cloud ERP offers several inbuilt UI interaction functions to make custom app development intuitive and dynamic. One of the widely used functions for quick user input is inputAlert().


Purpose

The inputAlert() function displays a modal input box to the user. Once the user enters data and confirms, the function passes the inputted value to the specified callback function.

This is particularly useful when you want to:

  • Prompt users for quick input (like a note, quantity, or code)
  • Perform actions dynamically based on user input
  • Simplify and streamline UI interactions without building separate forms

Syntax

inputAlert(wintitle='Notes', title='Input', value='', callbackOk)

Parameters

Parameter Type Default Description
wintitle String 'Notes' Title of the input popup window
title String 'Input' Label shown inside the dialog above the input field
value String '' Default value shown in the input field
callbackOk Function Callback function that receives the user-entered value as an argument

sage Example

inputAlert(
  wintitle = 'Customer Note',
  title = 'Enter note for this customer:',
  value = '',
  callbackOk = function(userInput) {
    console.log('User entered:', userInput);
    // You can now use userInput to perform further logic
  }
);

Key Notes

  • The function is non-blocking and works asynchronously.
  • Ensure the callbackOk function handles scenarios where user may submit empty input.
  • You can localize wintitle and title to enhance user experience in multilingual environments.

Ideal Use Cases

  • Asking for approval remarks or rejections
  • Capturing short user inputs like reference numbers
  • Collecting quick feedback within app workflows

Stay productive and interactive with Merciglobal Cloud ERP’s intuitive UI functions like inputAlert()! 🚀