Jump to content
  • 0

How do I code a JavaScript pop up window


xarzu
 Share

Question

What is the best and easiest way to have a modal window pop up in JavaScript code?  I have a function in JavaScript where I would like to put a modal pop up window code in so what I know it is being hit.  I did a search engine search on the internet for examples of this but everything I found was accompanied with HTML and CSS code.  That is not what I am looking form.  Please advise.

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0
On 2/22/2018 at 7:28 AM, xarzu said:

What is the best and easiest way to have a modal window pop up in JavaScript code?  I have a function in JavaScript where I would like to put a modal pop up window code in so what I know it is being hit.  I did a search engine search on the internet for examples of this but everything I found was accompanied with HTML and CSS code.  That is not what I am looking form.  Please advise.

Hi Xarzu,

Try this code:

<script type="text/javascript">
// Popup window code
function newPopup(url) {
 popupWindow = window.open(
  url,'popUpWindow','height=300,width=400,left=10,top=10,resizable=yes,scrollbars=yes,toolbar=yes,menubar=no,location=no,directories=no,status=yes')
}
</script>
<p><a href="JavaScript:newPopup('https:www.thenameofthepage.com');">Pop Up Window</a></p>
 

You may play around with the width and height of the popup window based on your desired display.

regards,

Franchiser

Link to comment
Share on other sites

  • 0

Do you want a modal or a popup? You can easily make a modal menu with HTML5 and CSS. However, I have noticed that Caspio forms do not play too nicely with modal windows. I had to do some hacky things to get them to work.  If you would like more information, I will be happy help.

Link to comment
Share on other sites

  • 0
On 3/8/2018 at 10:55 AM, alineer said:

Do you want a modal or a popup? You can easily make a modal menu with HTML5 and CSS. However, I have noticed that Caspio forms do not play too nicely with modal windows. I had to do some hacky things to get them to work.  If you would like more information, I will be happy help.

Hi there,  I have been trying to get modals to work and you are correct the forms do not play nicely.  If you have a solution I would appreciate it.  thank you.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...