how to do a javascript alert box that contain a button with a class like this submit button:
<input type="submit" class="lightbox">
or there is any way to make a javascript form that pop up and contain this submit button?
how to do a javascript alert box that contain a button with a class like this submit button:
<input type="submit" class="lightbox">
or there is any way to make a javascript form that pop up and contain this submit button?
I would use this code:
var doc = document, htm = doc.documentElement, bod = doc.body;
function E(e){
return doc.getElementById(e);
}
function winOpen(clickId, url, name, height, width){
var ht = innerHeight || htm.clientHeight || bod.clientHeight;
var wd = innerWidth || htm.clientWidth || bod.clientWidth;
ht = (height-ht)/2; wd = (width-wd)/2;
E(clickId).onclick = function(){
open(url, name, 'height='+height+',width='+width+',top='+ht+',left='+wd);
}
}
// You would use this like
winOpen('newWindow', 'wherever.html', 'windowName', 500, 500);
whatever.html
should be the page with your lightbox
class.
Standard browser alerts are not stylable - it will have to be done in code. If you don't want to window.open
a new page and willing to use a 3rd party library - jQueryUI is a good choice. The Dialog is fully stylable- yes, including button.