Jellybean
01-06-2005, 11:53 PM
Hi there,
Just trying my luck to see whether I can get some help here.
This is a very cool site http://www.kevinroth.com/rte/demo.htm (which might be helpful to some of you) where you will be able to get functions like highlight, bold, underline, very much similar to the layout that we are using in the email system.
Well, actually I am using this sample as a reference to develop something similar to an email system. So far I can modify the codes and get what I want.
However, I encountered some problems lately.
If someone can be kind enough to take a look at the site and the Demo.txt file I have attached.
Demo.txt (focus on this portion of the script)
//We can place our predefined text in the textarea
<?
$content = "here's the ". chr(13) ."\"preloaded <b>content</b>\"";
$content = RTESafe($content);
?>//Usage: initRTE(imagesPath, includesPath, cssFile)
initRTE("images/", "", "");
</script>
<noscript><p><b>Javascript must be enabled to use this form.</b></p></noscript>
<script language="JavaScript" type="text/javascript">
<!--
//Usage: writeRichText(fieldname, html, width, height, buttons, readOnly)
writeRichText('rte1', '<?=$content?>', 520, 200, true, false);
//-->
</script>
Basically I am am trying to do is to extract something like this:
<p>This is an example</p><p>I need to have a php <?php echo $variable?></p>
from the database and assigning it as $content. Note that $variable is declared earlier in example.php
Now I would like to display this text as a default statement in the textarea.
<script language="JavaScript" type="text/javascript">
<!--
//Usage: writeRichText(fieldname, html, width, height, buttons, readOnly)
//writeRichText('standard_reply', '<?php echo $content;?>', 520, 300, true, false);
//-->
</script>
However, $variable cannot be displayed in the textarea.
Which part of the script must I change such that $variable will be shown in the textarea?
FYI, this can be done:
writeRichText('standard_reply', '<p>This is an example</p><p>I need a php <?php echo $variable;?></p>', 520, 300, true, false);
Any advise is most appreciated.
Thanks for reading and have a great day!
Just trying my luck to see whether I can get some help here.
This is a very cool site http://www.kevinroth.com/rte/demo.htm (which might be helpful to some of you) where you will be able to get functions like highlight, bold, underline, very much similar to the layout that we are using in the email system.
Well, actually I am using this sample as a reference to develop something similar to an email system. So far I can modify the codes and get what I want.
However, I encountered some problems lately.
If someone can be kind enough to take a look at the site and the Demo.txt file I have attached.
Demo.txt (focus on this portion of the script)
//We can place our predefined text in the textarea
<?
$content = "here's the ". chr(13) ."\"preloaded <b>content</b>\"";
$content = RTESafe($content);
?>//Usage: initRTE(imagesPath, includesPath, cssFile)
initRTE("images/", "", "");
</script>
<noscript><p><b>Javascript must be enabled to use this form.</b></p></noscript>
<script language="JavaScript" type="text/javascript">
<!--
//Usage: writeRichText(fieldname, html, width, height, buttons, readOnly)
writeRichText('rte1', '<?=$content?>', 520, 200, true, false);
//-->
</script>
Basically I am am trying to do is to extract something like this:
<p>This is an example</p><p>I need to have a php <?php echo $variable?></p>
from the database and assigning it as $content. Note that $variable is declared earlier in example.php
Now I would like to display this text as a default statement in the textarea.
<script language="JavaScript" type="text/javascript">
<!--
//Usage: writeRichText(fieldname, html, width, height, buttons, readOnly)
//writeRichText('standard_reply', '<?php echo $content;?>', 520, 300, true, false);
//-->
</script>
However, $variable cannot be displayed in the textarea.
Which part of the script must I change such that $variable will be shown in the textarea?
FYI, this can be done:
writeRichText('standard_reply', '<p>This is an example</p><p>I need a php <?php echo $variable;?></p>', 520, 300, true, false);
Any advise is most appreciated.
Thanks for reading and have a great day!