[Solved] Canceling out of an InputBox lazarus / 61-Beginners ---------------------------------------------------------------------- heebiejeebies · 2021-08-22 00:48 Hi guys, Judging from the wiki, it seems as though the only way to determine if a user cancelled out of an InputBox is to check if the returned string is the same as the default value specified in the call to the InputBox.  For example, this works: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i UserInput := InputBox('',    'Please enter some text', 'Placeholder text');      if UserInput = 'Placeholder text' then exit; // continue with rest of program otherwise   But I really don't like this.  There are a few instances where the user could easily be lazy and just enter the placeholder text to get something done quickly, then go back and change it later.  Acting as though they had cancelled would come across like a bug.  Any other way to do this properly? Thanks! ---------------------------------------------------------------------- dseligo · 2021-08-22 01:10 You can use InputQuery to check if user pressed Cancel. ---------------------------------------------------------------------- Zvoni · 2021-08-23 06:49 Quote from: heebiejeebies on August 22, 2021, 02:48:20 am Any other way to do this properly? Thanks! Don't use InputBox. Design your own Form ---------------------------------------------------------------------- heebiejeebies · 2021-08-23 08:28 Thanks guys. Appears that InputQuery does the job and I don't need to create my own form, which is less work for me. For any future googlers, Lucamar provides the code here: https://forum.lazarus.freepascal.org/index.php/topic,53822.msg398654.h tml#msg398654