Appending user-supplied parameter to url

Posted on 2010-01-07
Medium Priority
Last Modified: 2012-05-08
Hello -

I am using a solution supplied by William007 that takes user-input, appends it to a url, then launches that url.  I am using it in Form Web Part in Sharepoint.  It seemed simple enough, but when I use the code below, all I get when I press the button is a reload of the same page.  When I hoover over the submit button, the url of the current page shows up at the bottom of the browser.  What could I be missing to get this to work?

function gotourl(){
        var text=document.getElementById("txtMyTextbox").value;
        document.location ="http://sharepointtest.companyzyx.com/collaborationproject/GlobalStandards/standards/"+text
<input type="text" id="txtMyTextbox"/>
<input type="submit" value="submit" onClick="gotourl()"/>
Question by:detmers
LVL 82

Accepted Solution

hielo earned 2000 total points
ID: 26205183
<input type="submit

<input type="button

<input type="button" value="submit" onClick="gotourl()"/> 

Open in new window


Author Comment

ID: 26205255
Solution worked - thanks for the fix!

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…
Suggested Courses

807 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question