douying0108 2013-06-05 07:04
浏览 126

如何为TinyMCE编辑器提供id

I am trying to develop an application in which "When I select option from dropdown the below fields should fill automatically(One is text field and other is TinyMCE Esitor)". Below is the code I tried.

<?php
defined('_JEXEC') or die('Restricted access');

?>

 <script type="text/javascript">
function showTemplate()
{   
    document.getElementById("jform_page_title").value = document.getElementById("jform").value;
    alert("clicked");
}

</script>


<form action="" method="post" name="adminForm" id="adminForm">

<table class="admintable">
  <tbody>

 <tr>
    <td>
      <label for="jformid"><?php echo JText::_('JTAG_LEGAL_PAGES_CHOOSE_TEMPLATE');?>
    </label>
    </td>
    <td>
<select id="jform" onchange="showTemplate()">

<?php foreach($this->templates as $template): //print_r($template);exit; ?>
<option value="<?php echo $template->id; ?>"> <?php echo $template->template_title; ?></option> 

<?php endforeach; ?>
</select> 
    </td>   

  </tr>

<tr></tr>


<tr>
  <td>
    <label for="jform_page_title"><?php echo JText::_('JTAG_LEGAL_PAGES_TEMPLATE_TITLE'); ?></label>
  </td>
  <td>
    <input type="text" size="30" class="inputbox required" id="jform_page_title" value="<?php echo $this->template->template_title; ?>" name="jform[page_title]" />
  </td>
</tr>

<tr></tr>

<tr>
  <td>
    <label for="jform_description"><?php echo JText::_('JTAG_LEGAL_PAGES_TEMPLATE_DESCRIPTION'); ?></label>
  </td>
  <td>
    <?php
    $editor =& JFactory::getEditor();
      echo $editor->display('jform[description]', htmlspecialchars($this->lpsettingdata->description, ENT_QUOTES),'550','300','60','20',array('pagebreak','readmore'));
    ?>
  </td>
</tr>


  </tbody>
 </table>

<input type="hidden" value="<?php echo $this->lpsettingdata->id; ?>" name="jform[id]" />


<input type="hidden" name="task" value="" />
<input type="hidden" name="controller" value="jtaglegalpages" />

</form>


Please let me know how to give id to the editor.
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 2024-五一综合模拟赛
    • ¥15 下图接收小电路,谁知道原理
    • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
    • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
    • ¥15 手机接入宽带网线,如何释放宽带全部速度
    • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
    • ¥15 ETLCloud 处理json多层级问题
    • ¥15 matlab中使用gurobi时报错
    • ¥15 这个主板怎么能扩出一两个sata口
    • ¥15 不是,这到底错哪儿了😭