So, I’m trying to learn how to create a form that that
pops up
isn’t a window that can be moved
and doesn’t make me leave the current page.
Provides a darkened transparent background drop that hides the content on the current page.
I’ve watched some javascript tutorials and have a small base but still am not quite sure what I should be looking to learn in order to accomplish this.
I just need some direction on what I should be looking at to accomplish this. I looked at this page, but I think I still need more info.
Any suggestions on where I can start to learn how to do this?
jQuery would be best I’m guessing. I mainly know html, css, and wordpress. I’ve done some javascript and jquery tutorials and so jQuery would prob be best.
A modal window (otherwise called a lightbox) can serve a lot of purposes. It can act as a dialog box, like in the tutorial Paul kindly provided, or can contain other elements.
Now since it’s a form you need to display in the lightbox, I suggest you check out 123ContactForm - free form builder. It’s a dedicated app that can build JavaScript lightbox forms intuitively, without any coding on your side. You just create the layout of your form in a drag & drop editor, then copy the lightbox code and paste it onto your website.
I’ve been with them several years, great service to deal with.
Well, I played with the code some from js fiddle, but can’t quite get the same code to work. What am I missing? I’m just trying to get the sample code to work before playing with it. Is it that I’m using the absolute urls for jQuery? I’m getting some sleep, but definitely am going to dive into it tomorrow/today.
Okay so I got it working for the most part but I’m having troubles understanding the styling of <button id=“create-user”>Create new user</button> and items on the pop up like close button right now in the top right hand corner which you can’t see til you hover over it, the create an account button, and the cancel button.
I think that the jquery-ui file is providing the styles for these but I just don’t see where. I see no #create-user
Is there something tricky about how this is styled???
In regard to the close button - the HTML code is appearing on your page for it, so the blame must go to your styles which don’t seem to do anything yet in regard to the .ui-dialog-titlebar-close class.
Yes I see the id for the button, but I don’t see the style for it in the style sheet. Also, I did look at you jsfiddle example, but ended up using the code from the other site that you recommended. http://jqueryui.com/dialog/#modal-form
So, I guess I don’t see where you’re styling your button your js fiddle example???
I don’t know what you want me to look at on this page?
Okay I got the styling to work using this as a tester
#create-user {
background-color:#00CC33;
}
I was just confused because I saw no css for it and so those default colors were coming from where???
I am beginning to understand this code now. I see where I could edit the create button and the cancel button on the pop up. I don’t see and id or understand the class I use to style these though???