在SharePoint博客站点上,用户通过在div中键入contenteditable设置为true来插入新帖子。这在iPad上是行不通的,因为iPad上的Safari不支持它。
我可以找到div并删除该属性,但是,我如何能够插入文本呢?我可以用一个多行文本框替换整个div吗(不确定SharePoint在保存时是怎么想的)?
HTML如下所示:
<tr>
<td nowrap="true" valign="top" width="190px" class="ms-formlabel">
<h3 class="ms-standardheader">
<nobr>Body</nobr>
</h3>
</td>
<td valign="top" class="ms-formbody">
<!-- FieldName="Body"
FieldInternalName="Body"
FieldType="SPFieldNote"
-->
<span dir="none"><div class='ms-rtestate-field ms-rtefield' style=''><div id='ctl00_m_g_cc0fae80_c5f8_428c_9d00_793718f1d202_ctl00_ctl04_ctl01_ctl00_ctl00_ctl04_ctl00_ctl00_TextField_inplacerte_label' style='display:none'>Rich text editor</div><div class=' ms-rtestate-write ms-rteflags-0' id='ctl00_m_g_cc0fae80_c5f8_428c_9d00_793718f1d202_ctl00_ctl04_ctl01_ctl00_ctl00_ctl04_ctl00_ctl00_TextField_inplacerte' style='min-height:210px' aria-labelledby='ctl00_m_g_cc0fae80_c5f8_428c_9d00_793718f1d202_ctl00_ctl04_ctl01_ctl00_ctl00_ctl04_ctl00_ctl00_TextField_inplacerte_label' contentEditable='true' ></div><div style="clear:both;"></div></div>
<span dir="ltr">
<input name="ctl00$m$g_cc0fae80_c5f8_428c_9d00_793718f1d202$ctl00$ctl04$ctl01$ctl00$ctl00$ctl04$ctl00$ctl00$TextField_spSave" type="HIDDEN" id="ctl00_m_g_cc0fae80_c5f8_428c_9d00_793718f1d202_ctl00_ctl04_ctl01_ctl00_ctl00_ctl04_ctl00_ctl00_TextField_spSave" />
</span>
</span>
</td>
</tr>发布于 2011-11-22 12:30:05
您可以使用您所说的多行框来代替div,但是您需要在列表设置中更改列的字段属性,以使其不会更改代码,否则SharePoint可能会断开与您正在尝试更新的列表字段的连接。
如果你必须使用SharePoint的控制,你也可以隐藏div:style="display:none",并用一个通用文本区域的jQuery填充它,你可以把它放在SP Designer的页面上-可以得到它的.text()、.html()或.val() (我想不起来是哪一个了),将它分配给var textAreaText,然后使用
$('id$=inplacerte').html(textAreaText);https://stackoverflow.com/questions/6529788
复制相似问题