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条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 腾讯企业邮箱邮件可以恢复么
    • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
    • ¥15 错误 LNK2001 无法解析的外部符号
    • ¥50 安装pyaudiokits失败
    • ¥15 计组这些题应该咋做呀
    • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
    • ¥15 让node服务器有自动加载文件的功能
    • ¥15 jmeter脚本回放有的是对的有的是错的
    • ¥15 r语言蛋白组学相关问题
    • ¥15 Python时间序列如何拟合疏系数模型