- 论坛徽章:
- 0
|
本帖最后由 小公猫 于 2012-03-27 12:44 编辑
我想写个程序,在一个页面的编辑器中输入文本后自动提交,文本编辑器和对应的HTML代码分别如下:
- <tr>
- <td></td>
- <td colspan="2"><div id="mess_div">
- <div class="rteDiv" id="rteDiv_id">
- <div class="bordered">
- <div class="rteBack" id="Buttons1_mess">
- <p class="rte_toolbar"> <span class="rte_button">
- <select name="select" id="formatblock_mess" onChange="selectFont('mess', this.id);">
- <option value="">[风格]</option>
- <option value="<p>">Paragraph <p></option>
- <option value="<h1>">Heading 1 <h1></option>
- <option value="<h2>">Heading 2 <h2></option>
- <option value="<h3>">Heading 3 <h3></option>
- <option value="<h4>">Heading 4 <h4></option>
- <option value="<h5>">Heading 5 <h5></option>
- <option value="<h6>">Heading 6 <h6></option>
- <option value="<address>">Address <ADDR></option>
- <option value="<pre>">Formatted <pre></option>
- </select>
- </span> <span class="rte_button">
- <select name="select" id="fontname_mess" onChange="selectFont('mess', this.id)">
- <option value="Font" selected="selected">[字体]</option>
- <option value="Arial, Helvetica, sans-serif">Arial</option>
- <option value="Courier New, Courier, mono">Courier New</option>
- <option value="Times New Roman, Times, serif">Times New Roman</option>
- <option value="Verdana, Arial, Helvetica, sans-serif">Verdana</option>
- <option value="宋体">宋体</option>
- <option value="黑体">黑体</option>
- </select>
- </span> <span class="rte_button">
- <select name="select" id="fontsize_mess" onChange="selectFont('mess', this.id);" unselectable="on">
- <option value="Size">[大小]</option>
- <option value="1">1</option>
- <option value="2">2</option>
- <option value="3">3</option>
- <option value="4">4</option>
- <option value="5">5</option>
- <option value="6">6</option>
- <option value="7">7</option>
- </select>
- </span>
- </div>
- <div class="rteBack" id="Buttons2_mess">
- <p class="rte_toolbar"> <span class="rte_button"><img id="bold" class="rteImage" src="/rte/images/bold.gif" alt="Bold" title="粗体" onClick="rteCommand('mess', 'bold', '')" width="18"></span> <span class="rte_button"><img class="rteImage" src="/rte/images/italic.gif" alt="Italic" title="斜体" onClick="rteCommand('mess', 'italic', '')" width="18"></span> <span class="rte_button"><img class="rteImage" src="/rte/images/underline.gif" alt="Underline" title="下划线" onClick="rteCommand('mess', 'underline', '')" width="18"></span> <span class="rte_button"><img class="rteVertSep" src="/rte/images/blackdot.gif" alt="" border="0" height="18" width="2"></span> <span class="rte_button"><img class="rteImage" src="/rte/images/left_just.gif" alt="Align Left" title="左对齐" onClick="rteCommand('mess', 'justifyleft', '')" width="18"></span> <span class="rte_button"><img class="rteImage" src="/rte/images/centre.gif" alt="Center" title="居中" onClick="rteCommand('mess', 'justifycenter', '')" width="18"></span> <span class="rte_button"><img class="rteImage" src="/rte/images/right_just.gif" alt="Align Right" title="右对齐" onClick="rteCommand('mess', 'justifyright', '')" width="18"></span> <span class="rte_button"><img class="rteImage" src="/rte/images/justifyfull.gif" alt="两端对齐" title="两端对齐" onClick="rteCommand('mess', 'justifyfull', '')" width="18"></span> <span class="rte_button"><img class="rteVertSep" src="/rte/images/blackdot.gif" alt="" border="0" height="18" width="2"></span> <span class="rte_button"><img class="rteImage" src="/rte/images/hr.gif" alt="Horizontal Rule" title="水平线" onClick="rteCommand('mess', 'inserthorizontalrule', '')" width="18"></span> <span class="rte_button"><img class="rteVertSep" src="/rte/images/blackdot.gif" alt="" border="0" height="18" width="2"></span> <span class="rte_button"><img class="rteImage" src="/rte/images/numbered_list.gif" alt="Ordered List" title="有序列表" onClick="rteCommand('mess', 'insertorderedlist', '')" width="18"></span> <span class="rte_button"><img class="rteImage" src="/rte/images/list.gif" alt="Unordered List" title="无序列表" onClick="rteCommand('mess', 'insertunorderedlist', '')" width="18"></span> <span class="rte_button"><img class="rteVertSep" src="/rte/images/blackdot.gif" alt="" border="0" height="18" width="2"></span> <span class="rte_button"><img class="rteImage" src="/rte/images/outdent.gif" alt="Outdent" title="减小缩进" onClick="rteCommand('mess', 'outdent', '')" width="18"></span> <span class="rte_button"><img class="rteImage" src="/rte/images/indent.gif" alt="Indent" title="增大缩进" onClick="rteCommand('mess', 'indent', '')" width="18"></span> <span class="rte_button"><span id="forecolor_mess"><img class="rteImage" src="/rte/images/textcolor.gif" alt="Text Color" title="前景色" onClick="dlgColorPalette('mess', 'forecolor', '')" width="18"></span></span> <span class="rte_button"><span id="hilitecolor_mess"><img class="rteImage" src="/rte/images/bgcolor.gif" alt="Background Color" title="背景色" onClick="dlgColorPalette('mess', 'hilitecolor', '')" width="18"></span></span> <span class="rte_button"><img class="rteVertSep" src="/rte/images/blackdot.gif" alt="" border="0" height="18" width="2"></span> <span class="rte_button"><img class="rteImage" src="/rte/images/hyperlink.gif" alt="Insert Link" title="插入链接" onClick="dlgInsertLink('mess', 'link')" width="18"></span> <span class="rte_button"><img class="rteImage" src="/rte/images/image.gif" alt="Add Image" title="插入图片" onClick="addImage('mess')" width="18"></span> <span class="rte_button"><span id="table_mess"><img class="rteImage" src="/rte/images/insert_table.gif" alt="Insert Table" title="插入表格" onClick="dlgInsertTable('mess', 'table', '')" width="18"></span></span> <span width="100%"></span> </p>
- </div>
- <iframe id="mess" name="mess" frameborder="0"></iframe>
- <p id="sedit">
- <input name="checkbox" type="checkbox" id="chkSrcmess" onClick="toggleHTMLSrc('mess',true);">
-
- <label for="chkSrcmess">源文件编辑</label>
- </p>
- <iframe id="cpmess" src="/rte/includes/palette.htm" marginwidth="0" marginheight="0" style="display: none; position: absolute;" height="104" scrolling="no" width="154"></iframe>
- <input id="hdnmess" name="hdnmess" value="" type="hidden">
- </div>
- </div>
- <textarea style="display:none; width: 606px; " name="text" id="text" rows="15" wrap="virtual" onFocus="set_event(1);" onBlur="set_event(0);" onKeyDown="return event.keyCode!=27;"></textarea>
- <textarea style="display:none; width: 606px; " id="replymsg" name="replymsg"></textarea>
- <script language="javascript">
- change_body() ;
- </script>
- </div></td>
- </tr>
复制代码 这个编辑框在一个iframe中:
<iframe id="mess" name="mess" frameborder="0"></iframe>
请问要怎么样插入文本?像TextBox一样。
我用的是Win32::IEAutomation模块,比如给用户名输入框输入文本:$ie_login->getTextBox('name:',"username")->SetValue('myname');
这个文本编辑器要怎么赋值? |
|