Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
hello, i have installed jquery.ui-1.6 and jquery_ui-6.x-1.x-dev.tar and i want build dialog from element of my page
javascript code
$("#edit-field-name-0-value-wrapper").dialog();
give me error
TypeError: '$("#edit-field-name-0-value-wrapper").dialog' is not a function
i don't know js.
please, help me to understand how to fix it
Comments
Comment #1
ionmedia CreditAttribution: ionmedia commentedok, i found what where is no added all widgets by default and i must load needed via jquery_ui_add(array('ui.dialog', 'ui.draggable', 'ui.resizable'));
ok, i putt this into template.php and it's work, but how can i add js via jquery_ui_add to specified templates/nodes/pages ?
Comment #2
ionmedia CreditAttribution: ionmedia commentedi found solution and maybe some people need it too
add to your .tpl file (page-node-add.tpl) this
instead this
echo $scripts
Comment #3
ionmedia CreditAttribution: ionmedia commentedand with http://drupal.org/node/388384#comment-3667740
for adding needed css and js from ui to tpl
Comment #4
mikedotexe CreditAttribution: mikedotexe commentedThank you very much. I couldn't find a solution anywhere. It seemed so simple, but running a
$('#div').dialog(); wasn't accomplishing anything. Thank you for posting this.
Comment #5
prakhyatgailani CreditAttribution: prakhyatgailani commentedI guess applying
$("#dialog").dialog({
title: "jQuery Dialog Popup",
buttons: {
Close: function () {
$(this).dialog('close');
}
},
modal: true
});
might work
Comment #6
nod_Version for Drupal 6 is not supported anymore, closing.