Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problems making online web editor?

0 views
Skip to first unread message

Jan T.

unread,
Dec 29, 2009, 5:56:06 AM12/29/09
to
Hi. I am trying to make an WYSIWYG html editor using iframe.
There is a lot of commands you can use such as
function doBold()

{
iView.document.execCommand('bold', false, null);
}

However, when I try to make my text a heading, that is with h1 to
h6, the command doesn't work. The command for h1 is:

function doHead(hType)
{
if(hType != '')
{
iView.document.execCommand('formatblock', false, hType);
doFont(selFont.options[selFont.selectedIndex].value);
}
}

<select name="selHeading"
onChange="doHead(this.options[this.selectedIndex].value)">
<option value="">-- Heading --</option>
<option value="Heading 1">H1</option>
<option value="Heading 2">H2</option>
<option value="Heading 3">H3</option>
<option value="Heading 4">H4</option>
<option value="Heading 5">H5</option>
<option value="Heading 6">H6</opt
</select>

When I try to select one of the options, say I select h2 from the drop down
nothing happens. If am using the bold text command, that function works
fine?

What is wrong here? Anybody..

Thank you very much for your help.

Regards
Jan T.


Lars Eighner

unread,
Dec 29, 2009, 7:41:05 AM12/29/09
to
In our last episode,
<hKidnfvquYfbfaTW...@posted.comnet>,
the lovely and talented Jan T.
broadcast on alt.html:

> Hi. I am trying to make an WYSIWYG html editor using iframe.
> There is a lot of commands you can use such as
> function doBold()

> {
> iView.document.execCommand('bold', false, null);
> }

That isn't HTML. HTML does not have commands. It is a Markup
Language (that's what the ML in HTML stands for), not a programming
language.


--
Lars Eighner <http://larseighner.com/> Warbama's Afghaninam day: 27
659.5 hours since Warbama declared Viet Nam II.
Warbama: An LBJ for the Twenty-First century. No hope. No change.

Jan C. Faerber

unread,
Jan 3, 2010, 12:20:48 PM1/3/10
to
On Dec 29 2009, 11:56 am, "Jan T." <noreply> wrote:

>       <option value="Heading 6">H6</opt

</opt
... aehm ... not good.

> When I try to select one of the options, say I select h2 from the drop down
> nothing happens.

I don't see the script where it handles value="Heading 1".

Is it for a form?
Most of the time they don't use valid html tags there.

0 new messages