I am working with a standard content editor that utilizes an iFrame as the text area. Upon changing dropdown options, it triggers the following command:
idContent.document.execCommand(cmd,"",opt);
Where "idContent" refers to the iFrame.
One of the dropdown options is meant for styles, but it actually executes a "formatBlock" command.
I have a custom style sheet with unique styles. Is there a way for me to add these created styles into the style dropdown? If not, I can introduce another dropdown specifically for these custom styles, but what would be the command name to assign those styles?
Below is the current HTML code for the dropdown and corresponding JavaScript:
<select onchange="cmdExec('formatBlock',this[this.selectedIndex].value);this.selectedIndex=0">
<option selected>Style</option>
<option value="Normal">Normal</option>
<option value="Heading 1">Heading 1</option>
<option value="Heading 2">Heading 2</option>
<option value="Heading 3">Heading 3</option>
<option value="Heading 4">Heading 4</option>
<option value="Heading 5">Heading 5</option>
<option value="Address">Address</option>
<option value="Formatted">Formatted</option>
<option value="Definition Term">Definition Term</option>
</select>
function cmdExec(cmd,opt)
{
idContent.document.execCommand(cmd,"",opt);
idContent.focus();
}