TIWEdit and SubmitOnAsyncEvent - Printable Version +- Atozed Forums (https://www.atozed.com/forums) +-- Forum: Atozed Software Products (https://www.atozed.com/forums/forum-1.html) +--- Forum: IntraWeb (https://www.atozed.com/forums/forum-3.html) +---- Forum: English (https://www.atozed.com/forums/forum-16.html) +----- Forum: IntraWeb General Discussion (https://www.atozed.com/forums/forum-4.html) +----- Thread: TIWEdit and SubmitOnAsyncEvent (/thread-1181.html) Pages:
1
2
|
TIWEdit and SubmitOnAsyncEvent - brsoft - 08-14-2019 Hi, There is a little problem, I noticed by accident. Environment: - Delphi XE5 - Intraweb 15.1.3 - Windows 10 - Browsers: Chrome, FF, Edge Setting: TIWEdit SubmitOnAsyncEvent := False; It works differently when you press Enter: If there is only one TIWEdit, the form OnRender event starts If there is more TIWEdit, the OnRender event for the form will not start. I've attached the examples. Regards brsoft RE: TIWEdit and SubmitOnAsyncEvent - brsoft - 08-15-2019 Hi The error does not depend on the setting of SubmitOnAsyncEvent property: " It works differently when you press Enter: - If there is only one TIWEdit, the form OnRender event starts. (This is not good!) - If the form has more TIWEdit then OnRender event for the form won't start. (It's okay.)" The same happens if TIWRegion contains only one TIWEdit. Surprisingly many problems are caused by this error. RE: TIWEdit and SubmitOnAsyncEvent - kudzu - 08-15-2019 Ive asked Alexandre to look. RE: TIWEdit and SubmitOnAsyncEvent - Alexandre Machado - 08-15-2019 I'll test your project and let you know. hold on.... RE: TIWEdit and SubmitOnAsyncEvent - Alexandre Machado - 08-16-2019 This is not a bug but a standard behavior of HTML forms. In short, whenever a page contains only one input control, the browser will submit once ENTER key is pressed. Read more about it here: https://stackoverflow.com/questions/17797025/why-does-a-form-with-one-text-input-submit-on-enter-while-one-with-two-text-inpu and here https://www.philipphoffmann.de/post/browsers-automatically-submit-single-input-field-forms-on-enter-and-how-to-fix-that/ RE: TIWEdit and SubmitOnAsyncEvent - Alexandre Machado - 08-16-2019 BTW, if you want to prevent this behavior, just add this to your IWEdit's ScriptEvents, OnKeyDown: if (event.keyCode == 13) { event.preventDefault(); } RE: TIWEdit and SubmitOnAsyncEvent - brsoft - 08-16-2019 Hi Alexandre, Did you try the Demo I sent? To put it another way: If I press Enter in TIWRegion's only TIWEdit, how do I prevent the entire webpage from reloading? (Do not run the Onrender event.) In the new IW version (15.1.x), pressing Enter will always work with the OnRender event if there is only 1 TIWEdit in TIWRegion. Until v15.0.24 there was no such problem. regards RE: TIWEdit and SubmitOnAsyncEvent - brsoft - 08-17-2019 Hi Alexandre! I made a simple demo, please take a look! There are no TIWEdit events in the source code !!! Submittest application link: http://95.140.46.153/submittest If you press Enter on the "single TIWEdit / TIWRegion" of the second form, you will return to the previous form. This operation is not good! I think the v15.1.x "submitform" has a bug. In v15.0.24 this problem was not yet present. Comment: Pressing Enter causes two types of operating problems: 1. If ServerController "Users can start multiple independent sessions in browser tabs" = TRUE, the form will close and return to the previous form. 1. If the ServerController "Users can start multiple independent sessions in browser tabs" = FALSE, the OnRender event of the form starts to work. I've attached the source code. RE: TIWEdit and SubmitOnAsyncEvent - Alexandre Machado - 08-21-2019 I can confirm this application is behaving differently in 15.1 (and it shouldn't, at least regarding that aspect). I'll have a definitive answer soon. RE: TIWEdit and SubmitOnAsyncEvent - Alexandre Machado - 08-21-2019 There is a problem with FormDefaultSubmit() which is not preventing the form submission to happen. It is fixed now and we're building a new update. It should be ready for testing soon. |