Jump to content
Larry Ullman's Book Forums

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.

 

thanks

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

Link to comment
Share on other sites

 Share

×
×
  • Create New...