Page 1 of 1

Show JQuery Modal dialog

Posted: Mon May 18, 2020 2:36 am
by alex4orly
I am using the WWB Dialog, initially on load it is hidden
I know I can show it with a button click, but I want to do it programatically with Javascript

The reason, I have several dialogs and I want to decide based on the OS, should the onclick show the dialog

Some help please

Thanks

Re: Show JQuery Modal dialog

Posted: Mon May 18, 2020 6:04 am
by Pablo
For jQuery UI see:
https://api.jqueryui.com/dialog/

For Bootstrap see:
https://getbootstrap.com/docs/4.0/components/modal/

You can also look at the code that WWB generates for events.

Re: Show JQuery Modal dialog

Posted: Mon May 18, 2020 6:33 am
by alex4orly
Hello again,

I tried both, Jquery and Bootsrap.

I inserted the Dialog in WWB from the standard in the JQuery UI / Bootsrap

In either of the cases, I looked at the code that WWB is generating, I fail to figure out how to do it from the documentation

My Dialog ID is Dialog1 Na in the code generated I see the following line:

a id="Button6" href="https://squadron-125.org.il/mypdf/yoramavni.pdf" target="Extension2" onclick="$('#Dialog1').dialog('open');window.reload(true);return false;" style="display:inline-block;width:128px;height:30px;z-index:2;">הסיפור שלי</a>


Do I need to insert into the script this line ?
$('#Dialog1').dialog('open');

Thanks

Re: Show JQuery Modal dialog

Posted: Mon May 18, 2020 7:33 am
by Pablo
Do I need to insert into the script this line ?
$('#Dialog1').dialog('open');
Correct

Re: Show JQuery Modal dialog

Posted: Mon May 18, 2020 8:42 am
by alex4orly
Thanks again,

This works fine