Hii , I have a small php form. I need it to come in a pop up(dialog) when a user clicks a link .how do i do this using jquery .
A:
Hey, just look for jquery and dialog, this comes up: http://docs.jquery.com/UI/Dialog (I just assume you mean a HTML form as I don't know what you mean by 'php form'. php doesn't have forms)
zedoo
2010-03-21 14:05:45
i meant to say i have a form in page called login.phpand when i click on link like this<a href='/login.php' class='dialog'>Pradeep</a>its hould open the login.php page in a dialog box
pradeep
2010-03-21 16:20:26
+1
A:
Using the jquery UI Dialog
$(function() {
$('#myLink').click( function() {
$('<div title="Warning: A dialog"><p>Dialog contents</p></div>').dialog({
autoOpen: true,
modal: true, // or false
close: function() { $(this).dialog('destroy') } ),
... other options ...
});
});
});
If you need the dialog contents to be dynamic, you can use get()
to load some html from the server and set the HTML of the dialog from it or just construct the contents dynamically from elements on the page, if that's more appropriate.
tvanfosson
2010-03-21 14:13:28