Skip to main content
April 30, 2024
Solved

Key "ENTER" press should submit value in text box

  • April 30, 2024
  • 4 replies
  • 0 views

Hi Team,

I have a Text Box and Button beside that text box, when I enter anything in the text box and hit on "ENTER" button on keyboard I want the Button to submit the data.

Is it possible in Appian ?

Thanks 

Bihitak

    Best answer by mikes0011

    There's no OOB way to make the Enter button do this.  It will perform the text box's SaveInto (some people are unaware of this), but there's no way to make it trigger anything external such as a button click.  If the user presses "tab" they can tab to the button then press Enter or Space to trigger its behavior, though.

    4 replies

    harshk1671
    April 30, 2024

    Hi bihitakd0001,

    Can you share the use case that why you want to save data in DB on 'ENTER' button and not keeping in variable and save in DB after the submission of form?

    harshk1671
    May 1, 2024

    As I mentioned earlier saving data on hitting 'ENTER' in a text box is not a best practice. Although you can achieve it using 'writeRecords' or 'writeToDataStoreEntity'. Follow the code:

    a!localVariables(
      local!note,
      {
        a!textField(
          label: "Text",
          value: local!note,
          saveInto: {
            local!note,
            a!writeRecords(
              records: recordType(recordTypeField: local!note, )
            )
          }
        )
      }
    )

    mikes0011
    mikes0011Answer
    Brainy
    April 30, 2024

    There's no OOB way to make the Enter button do this.  It will perform the text box's SaveInto (some people are unaware of this), but there's no way to make it trigger anything external such as a button click.  If the user presses "tab" they can tab to the button then press Enter or Space to trigger its behavior, though.

    The Expression Guru
    May 1, 2024

    Thanks