How to check valid inputs in a Modal DialogI have written a jsl script which inputs three positive integers and creates a table. It works fine if the user gives valid inputs. My question is how can I verify the inputs to ensure that they are numeric and integers? Additionally, I would like to have the checking done within the modal dialog so that it will check for invalid input and give the user an opportunity to correct it. Lastly, my cancel button doesn't seem to abort the script.
Any help is appreciated.
//Create training, cross validation and test, column for a covariate input to DOE
New Window( "Create Cross Validation Covariate Table",
<<MODAL></MODAL>
Re: How to check valid inputs in a Modal Dialog<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />Thanks for the great example of how to code for input parameter checking.
Re: How to check valid inputs in a Modal DialogI think it would be better to do the checking before pressing "OK" (which typically closes a modal window... then it's late for regrets).
However, NumberEditBox() seems not to support scripts. Below is a variant of your example using NumberColEditBox() instead. Every edit activates a script that disables the OK button if one or more non-valid numbers are entered.
nw = New Window( "Create Cross Validation Covariate Table",
<<MODAL></MODAL>