Domanda

here is what i have. a sharepoint page that has a textbox and a search button. the textbox data is tied to all of my tables and fills them in according to the company code typed into the textbox.

i'm trying to add a url that will also take the user out to a new page where they will see a sharepoint list filtered on the company code they entered in the original textbox.

so far i can make the url go to whatever company i choose by hardcoding the url like this:

http://mysite/Lists/Call%20Log/Company%20by%20Category.aspx?View={7C16BC72-8F1A-457A-9908-AF9E66DE97DC}&FilterField1=LinkTitle&FilterValue1=abccompany

for whatever reason i am unable to or can't figure out how to set filtervalue1 = <<text from textbox>>.

here is a sample of the code:

<WebPartPages:SPProxyWebPartManager runat="server" id="ProxyWebPartManager">
</WebPartPages:SPProxyWebPartManager>
Enter the CO ID and click &quot;Search&quot;&nbsp;
<asp:TextBox runat="server" id="tb_coID" Width="83px"></asp:TextBox>
&nbsp;
<asp:Button runat="server" Text="Search" id="Button1"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a target="_blank" href="http://site/Lists/Call%20Log/Company%20by%20Category.aspx?View={7C16BC72-8F1A-457A-9908-AF9E66DE97DC}&amp;FilterField1=LinkTitle&amp;FilterValue1=<<text from textbox here>>">
Click Here </a>to view Call Logs
È stato utile?

Soluzione

in case anyeone else is looking this is the answer to my question that i figured out.

<script type="text/javascript">
function showReport() {
var coid = document.getElementById('ctl00_PlaceHolderMain_tb_coID').value;
window.open("http://site/Lists/Call%20Log/Company%20by%20Category.aspx?View=     {7C16BC72-8F1A-457A-9908-AF9E66DE97DC}&amp;FilterField1=LinkTitle&amp;FilterValue1=" +     coid, "_blank");
}
</script>
    <WebPartPages:SPProxyWebPartManager runat="server" id="ProxyWebPartManager">
    </WebPartPages:SPProxyWebPartManager>Enter the CO ID and click     &quot;Search&quot;&nbsp;
    <asp:TextBox runat="server" id="tb_coID" Width="83px"></asp:TextBox>
    &nbsp;
    <asp:Button runat="server" Text="Search" id="Button1"/>&nbsp;&nbsp;&nbsp;&    nbsp;&nbsp;
    <a href="javascript:void(0);" onclick="showReport();">Click Here</a> to view     Call Logs related to this Company<br>
    <br>

i just had to add these lines of code to the top of my page and it works amazingly

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top