Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
96
rated 0 times [  103] [ 7]  / answers: 1 / hits: 15447  / 14 Years ago, tue, may 4, 2010, 12:00:00

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.com/product.asp?=[TextBox Field Value]


More From » sharepoint

 Answers
159

There 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.com/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


[#96883] Sunday, May 2, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
aleighabayleef

Total Points: 511
Total Questions: 99
Total Answers: 99

Location: Aruba
Member since Fri, Jun 24, 2022
2 Years ago
;