Custom Dialog instead of jsPrompt - Forum

Forum Navigation
You need to log in to create posts and topics.

Custom Dialog instead of jsPrompt

Hi..

I want to use a custom dialog that has a input text and some buttons instead of the jsPrompt. I tried but it seems that the custom dialog is not pause the rest of the code running.  Check the demo app.

Thanks

 

Uploaded files:
  • You need to login to have access to uploads.

@smartmedia, try and move the verify function to a subroutine and call the subroutine from your custom dialog click event.

Uploaded files:
  • You need to login to have access to uploads.
smartmedia has reacted to this post.
smartmedia

Hi @darbdenral,

It seems to working but is not. I explain my self. You have transfer the code into a sub, now, if there is more code under the sub it will continue to run regardless if the custom window has shown up and wait the user to input the verification coed. In 2 words, the dialog is not pause the execution of the rest script.

Thanks for your answer..

 

It seems to working but is not. I explain my self. You have transfer the code into a sub, now, if there is more code under the sub it will continue to run regardless if the custom window has shown up and wait the user to input the verification coed. In 2 words, the dialog is not pause the execution of the rest script.

@smartmedia that's how JavaScript works: asynchronous and multithreading. The only way to pause the script execution is using jsAlert, jsConfirm or jsPrompt.
Its just a different way of programming but once you are used to, not much more difficult and quite more efficient.

Regards.

Hi @luishp

The only way to pause the script execution is using jsAlert, jsConfirm or jsPrompt.

ok, i can i have a custom jsPrompt window then ? or i am stack with that basic ugly window ?

@smartmedia jsPrompt calls the default JavaScript prompt() function. It creates a pop-up window. Unfortunately, this window cannot be styled or customized in any way.

smartmedia has reacted to this post.
smartmedia