Design showcase, Web Components
- December 9, 2008
Jquery modal prompt
If you’ve tried the impromptu jquery plugin, you’re probably left with some frustrating feeling, finding that such an easy solution for javascript alert, confirm and prompt replacement, could be enhanced by a nicer graphic design. Replacing the “X’” letter by a now standard close button, just like can be found on facebox, could do the job. But then why not benefit default facebook style layout and use the whole facebox plugin, or go for another stylish modal jquery plugin, such as jModal… A few lines of javascript code will easily replace the prompt function, just like the lines of code from the example below.
-
function jqPrompt(lang, uniqueId, qty , MsgPerso)
-
{
-
-
strPrompt ="Please enter your name";
-
msg = "<<div class=’notice-msg’ style=’border:0px;’>"+ strPrompt ;
-
msg = "<br><br><input type=’text’ size=’40′ value=’" + MsgPerso + "’ id=’persoValue’>";
-
msg += "<a href=’javascript:closeFaceBox( jQuery(\"#persoValue\").val() )’ class=’valid-button’> Submit</a>";
-
msg += ‘ <a href="javascript:closeFaceBox(null)" class="cancel-button">Cancel</a> ‘
-
msg += "</div>";
-
jQuery.facebox(msg)
-
}
-
function closeFaceBox(MsgPerso)
-
{
-
jQuery(document).trigger(‘close.facebox’);
-
if (uniqueId!=null && MsgPerso!="")
-
displayCart(lang, uniqueId, qty, MsgPerso)
-
}



One Response to “Jquery modal prompt”
a new implementation has been made public with prompt, alert, confirm jquery replacements . Check out
http://abeautifulsite.net/notebook_files/87/demo/
By admin on Jan 5, 2009