Jump to content
Larry Ullman's Book Forums
Sign in to follow this  

Want To Add A Modal Window

Recommended Posts

I want to add a modal window (created with css and javascript) to pop-up a form when a user clicks "add quote" button on one of my php script.

I have created a form in q1.html file, with required div settings. There is a modal.css file as Larry has given in the book. This html file on its own shows a poping up modal window with it's own "show window" button.


Now, I want to include this html file in one of the php script. If I use a link with <a href" tag pointing to q1.html file, it opens up in an entire new window. That is of no use to use a poping up modal form.


If I use "include('q1.html') file in php, the form stops working. The modal.css applies to the main page where I'm including this file. SO, how do I do it?


I think the problem comes from DOM, as modal.js file asks for elements in html file. But I don't understand how to resolve it.

I was searching on Internet, and all of it returns jquery solutions. At this point I don't want to use jqueary, as I want to learn javascript first.



Share this post

Link to post
Share on other sites

I can understand your frustration with trying to find a vanilla JS solution and only getting jQuery solutions. It happens to me all the time.


Anyway, I have to admit that I don't really know what you're asking. From what I can tell, it seems like you have written the HTML and CSS for a page that you want to have open in a separate window when the user clicks the Add Quote button in the main window. Is that correct?


If any part of my guess is wrong, please correct me and I will try to help.

Share this post

Link to post
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.

Reply to this topic...

×   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.

Sign in to follow this  

  • Create New...