Agree, I don’t think it should be an issue. You make an interesting point about the page vs site. I tried a few things, none of which seems to fix the issue:
- Include the code in the page onReady() function only
- Include the code in the site and page onReady() functions
- Added an onKeyPress: function to the input using the Developer Properties dialog and inserted the save code into that function. (When I do this, the function is added to the site code automatically, not the page code)
- Moved the input and dataset into the page and included the code in the page onReady() function
- Moved the input and dataset into the page and included the code in an onKeyPress: function added using the Developer Properties dialog (in the page code, not site code)
In every case I see all key presses logged including the Enters. And I also get the same uncaught error whenever I click Enter in each scenario above.
(One other accidental test I did is I disconnected the input form from the dataset. In this scenario pressing Enter in the input box after typing the email works every time. The dataset also saves every time, except that it saves a blank entry because the input is not connected.)
Finally one other thing I tested is I removed the “required” setting from the input box. When I remove this setting, pressing Enter triggers the save behavior, but for some reason the database saves a blank entry. (I confirmed that the input and dataset were connected for this test.)
Just to be clear, the error I previously pasted about the uncaught promise seems to be triggered based upon whether I have the “required” setting enabled. It seems that i must click off of the field for the field to validate that a value has been provided, and that is why I get the validation error. (Not sure if that is a bug or intended behavior.) However, it seems that there is an additional issue where the value of the field is not picked up by the dataset unless the field is marked as required. (Again, possibly a bug, but not sure what the intended behavior should be.)
I am going to try a work around to make #input8 not “required”, and then in the code I will try to insert the value from the field directly into the database using the setFieldValue method of #dataset2.
Let me know if you think that approach would work?