Skip to content

Instantly share code, notes, and snippets.

@uipoet
Created May 4, 2012 21:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uipoet/2597918 to your computer and use it in GitHub Desktop.
Save uipoet/2597918 to your computer and use it in GitHub Desktop.
Ninja UI Dialog with a Form
var
$form = $('<form/>'),
$formInput = $('<input/>', {
type: 'text'
}).appendTo($form),
$dialogCheckbox,
$dialog = $.ninja.dialog({
html: $form
}).attach(function () {
$dialogCheckbox.attr({
checked: 'checked'
});
}).detach(function () {
$dialogCheckbox.attr({
checked: false
});
});
$dialogCheckbox = $('<input/>', {
type: 'checkbox'
}).change(function () {
if ($dialogCheckbox.attr('checked')) {
$dialog.attach();
} else {
$dialog.detach();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment