Thanks, but actually, the form tags are there, I just didn't include
them in my example. The form is so huge I thought it would be
overwhelming to post the whole thing. I've now got it workin on one
page but not another, so whatever the problem is, it must be very
small, perhaps a missing semi-colon or something.
This works without a problem in IE:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
<input type="button" value="bold"
onclick="wrapSelectionBold(this.form.inputId2)" />
<input type="button" value="italic"
onclick="wrapSelectionItalic(this.form.inputId2)"/>
<input type="button" value="blockquote"
onclick="wrapSelectionBlockQuote(this.form.inputId 2)"/>
<input type="button" value="big headline"
onclick="wrapSelectionBigHeadline(this.form.inputI d2)"/>
<input type="button" value="small headline"
onclick="wrapSelectionSmallHeadline(this.form.inpu tId2)"/>
<div class="formElement">
Type a brief description for your Weblog; <br>
Or type the full contents of your Webpage:<br>
<textarea id="inputId2" name="formInputs[cbMainContent]"
class="textareaInput"></textarea>
<p>HTML into symbols? <input type="checkbox"
name="formInputs[usingHtml]" value="y" class="textareaCheckbox"></p>
</div>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
But this does not, and I have trouble seeing the difference:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
<input type="button" value="bold"
onclick="wrapSelectionBold(this.form.inputId2)" />
<input type="button" value="italic"
onclick="wrapSelectionItalic(this.form.inputId2)"/>
<input type="button" value="blockquote"
onclick="wrapSelectionBlockQuote(this.form.inputId 2)"/>
<input type="button" value="big headline"
onclick="wrapSelectionBigHeadline(this.form.inputI d2)"/>
<input type="button" value="small headline"
onclick="wrapSelectionSmallHeadline(this.form.inpu tId2)"/>
<input type="button" value="make a link"
onclick="wrapSelectionMakeALink(this.form.inputId2 )"/>
<div class="formElement">
Type your main content: <br/>
<textarea id="inputId2" name="formInputs[cbMainContent]"
class="textareaInput"></textarea>
<p>HTML into symbols? <input type="checkbox"
name="formInputs[usingHtml]" value="y" class="textareaCheckbox"></p>
</div>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
I use the same functions on both, except for this one:
function wrapSelectionMakeALink (element) {
var range = document.selection.createRange();
address = prompt('What address?');
address = '<a href=\"' + address + '\">';
if (range.parentElement() == element)
range.text = address + range.text + '<\/a>';
}
kaeli <> wrote in message news:<>. ..
> In article < >,
> enlightened us with...
> > I had this working in IE and suddenly in stopped working, even in IE.
> > For the life of me, I can't see what mistake I made. Does anyone see
> > what mistake I made? (this bit from one of my forms)
> >
> >
>
> Forgot the form tag needs to be around that textarea, since you use
> this.form.inputId2 to reference it?
> This worked fine for me in IE6.
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
> "http://www.w3.org/TR/REC-html40/loose.dtd">
> <html>
> <head>
> <title> New Document </title>
> </head>
>
> <body>
> <script language="javascript" type="text/javascript">
> function wrapSelectionBold (element) {
> alert(element);
> var range = document.selection.createRange();
> if (range.parentElement() == element)
> range.text = '<b>' + range.text + '<\/b>';
> }
> function wrapSelectionItalic (element) {
> var range = document.selection.createRange();
> if (range.parentElement() == element)
> range.text = '<i>' + range.text + '<\/i>';
> }
> function wrapSelectionBlockQuote (element) {
> var range = document.selection.createRange();
> if (range.parentElement() == element)
> range.text = '<blockquote>' + range.text + '<\/blockquote>';
> }
> function wrapSelectionBigHeadline (element) {
> var range = document.selection.createRange();
> if (range.parentElement() == element)
> range.text = '<h1>' + range.text + '<\/h1>';
> }
> function wrapSelectionSmallHeadline (element) {
> var range = document.selection.createRange();
> if (range.parentElement() == element)
> range.text = '<h3>' + range.text + '<\/h3>';
> }
> function wrapSelectionMakeALink (element) {
> var range = document.selection.createRange();
> address = prompt("What address?");
> address = '<a href=\"' + address + '\">';
> if (range.parentElement() == element)
> range.text = address + range.text + '<\/a>';
> }
> </script>
>
> <form>
> <input type="button" value="bold"
> onclick="wrapSelectionBold(this.form.inputId2)" />
> <input type="button" value="italic"
> onclick="wrapSelectionItalic(this.form.inputId2)"/>
> <input type="button" value="blockquote"
> onclick="wrapSelectionBlockQuote(this.form.inputId 2)"/>
> <input type="button" value="big headline"
> onclick="wrapSelectionBigHeadline(this.form.inputI d2)"/>
> <input type="button" value="small headline"
> onclick="wrapSelectionSmallHeadline(this.form.inpu tId2)"/>
> <input type="button" value="make a link"
> onclick="wrapSelectionMakeALink(this.form.inputId2 )"/>
>
>
> <div class="formElement">
> Type your main content:
> <textarea id="inputId2" name="formInputs[cbMainContent]"
> class="textareaInput"></textarea>
> <p>HTML into symbols? <input type="checkbox"
> name="formInputs[usingHtml]" value="y" class="textareaCheckbox"></p>
>
> </div>
> </form>
>
> </body>
> </html>
>
> --