Jump to content

My rich text editor automatically adds divs?


creata.physics

Recommended Posts

I have a rich text editor that I use for my site which was working just fine for me last night.

 

Now I'm not sure what happened but all of a sudden it started adding div tags by default which I do not understand in the slightest.

 

I'm assuming it is the rich text editor doing this, because when I replaced the javascript that calls the textarea with actual html, <textarea name='text'></text> it does not automatically add <div> or <br>, but when I use my code it goes ahead and does it.

 

here is a link to the source of my text editor:

http://zext.org/templates/default/scripts/richtext.js

 

this is the html I use to call the edtior, which worked fine until yesterday:

<script language="JavaScript">function submitForm() { updateRTEs(); return true; }</script>
<form onSubmit="return submitForm();" method="post" enctype="multipart/form-data" action="">
<script language="JavaScript" type="text/javascript" src="templates/<#TEMPLATE#>/scripts/richtext.js"></script>
<script language="JavaScript" type="text/javascript">initRTE("templates/<#TEMPLATE#>/images/bbcode/", "templates/<#TEMPLATE#>/rte/", false); </script>
<table class="main" cellspacing="1" cellpadding="8">
	<col width="25%"><col width="75%">
		<tr class="head"><td colspan="5">› Editing Content</td></tr>
		<tr>
			<td class='row2' valign="top">
				<div class='smiley_wrap' style='border: solid 1px #e1e1e1; padding: 5px; margin: 5px;background: #fff; width: 150px;text-align:center;float:right;'>
					<script type='text/javascript'>writeRichText('textarea', 'emoticons', '{$smilies}');</script>
				</div>
			</td>
			<td class='row1'>
				<table cellspacing="0" cellpadding="0">
					<tr>
						<td>
							<table class="rte" cellspacing="1" cellpadding="2">
								<tr class="rte_head">
									<td><script type="text/javascript">writeRichText("textarea", "bbcode", "", 1);</script></td>
								</tr>
								<tr class="row1">
									<td><script type='text/javascript'>writeRichText('textarea', 'textarea', '', '', '0', '$text', 400, 200);</script></td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
			</td>
		</tr>

 

I'm not sure why it's doing this or what happened to make it do this in the first place.  Like I said it was working fine last night, I powered off my comp, turned it back on and now it's not working.

 

Also yes, I've made sure <#TEMPLATE#> is properly replaced and that the directory for the source is loaded properly.

 

Any ideas will be much appreciated.

 

Thanks, Matt.

Link to comment
Share on other sites

Sorry for the bump but I had thought the issue was resolved, it seems the code is doing this once more and it's quite a bother, it's making this an issue with parsing my html properly somehow.  help is still needed for anybody willing to take a look.

 

It seems the issue is with google chrome!  In firefox divs aren't automatically added, but in google chrome they are, what can I do about this?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.