infoTab.add( // Add a text field to the "info" tab
{
type : 'select',
label : 'Rel:',
id : 'relField',
'default' : "",
items:
[
["<none>", ""],
["nofollow external (new window, icon)", "nofollow external"],
["nofollow outbound (new window)", "nofollow outbound"]
],
onChange:function()
{
var dialog = this.getDialog();
alert(dialog.getValueOf('info', 'relField')); // displays selected value
}
});
Wed, 09/22/2010 - 13:12
#1

Re: Custom fields in Dialogs?
dialogDefinition.onOk = function() { var link = '<a href="'; var protocolField = this.getContentElement('info', 'protocol'); link += protocolField.getValue(); var urlField = this.getContentElement('info', 'url'); link += urlField.getValue() + '"'; var relField = this.getContentElement('info', 'relField'); var rel = relField.getValue(); if (rel != "") { link += ' rel="' + rel + '"' } link += '>' + 'Anchor' + '</a>'; var editor = $('#content').ckeditorGet(); editor.insertHtml(link); }