admin管理员组文章数量:1391964
I'm trying to use the form web part to do the following
[TextBox Field for typing a product number] [Submit Button]
On Click of submit should go to:
.asp?=[TextBox Field Value]
I'm trying to use the form web part to do the following
[TextBox Field for typing a product number] [Submit Button]
On Click of submit should go to:
http://www.link./product.asp?=[TextBox Field Value]
Share Improve this question asked May 4, 2010 at 17:22 Aditya TAditya T 1473 gold badges4 silver badges14 bronze badges1 Answer
Reset to default 2There is actually nothing specific to SharePoint here - this will work the same directly in a html page, using a Form web part or a Content Editor web part (CEWP)
<!-- Catch Enter (KeyCode 13) and submit form -->
<div onkeydown="if (event.keyCode == 13) productSearch()">
<input type="text" name="productId" id="productId"/>
<input type="button" value="Go" onclick="productSearch()"/>
</div>
<script>
function productSearch()
{
var url = "http://www.link./product.asp?="
+ document.getElementById("productId").value;
// Open location in current window
window.location.href = url;
// or Open location in new window
window.open(url);
}
</script>
See window.open documentation for more options when opening a new window
本文标签: Sharepoint Form Webpart with JavascriptStack Overflow
版权声明:本文标题:Sharepoint Form Webpart with Javascript - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744709938a2621068.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论