XModPro

text box filter

Paul Buckley Paul Buckley asked Aug 2, 2015
Active Aug 5 · Viewed 2245 times
<p>how would I add several text boxes to a template that are&nbsp;being fed to a jquery that then feeds another template to a stored proecure that runs a like filter on a&nbsp;dataset.</p><p>This is what I want to do</p><p><img src="/Portals/0/Users/194/86/8386/getelementbyid.png?ver=2015-08-05-015508-187"></p><p>This is what I have created in the templates,&nbsp;but the alert test for the javascript is not working. How do I fault find and where do I put javascript objects in the template to access as a function.</p><p>&lt;xmod:scriptblock scriptid="srch5" registeronce="true"&gt;</p><p> &lt;script language="javascript"&gt;</p><p><strong><em>function searchnow(){</em></strong></p><p><strong><em> var sa = document.getElementById("Last");</em></strong></p><p><strong><em>var Lastlst = sa.options[sa.selectedIndex].value;</em></strong></p><p><strong><em> var w = document.getElementById("Supply");</em></strong></p><p><strong><em> var Suplst = w.options[w.selectedIndex].value;</em></strong></p><p><strong><em> var y = document.getElementById("Farm");</em></strong></p><p><strong><em> var Farmlst = y.options[y.selectedIndex].value;</em></strong></p><p><strong><em> /*</em></strong></p><p><strong><em> Build url </em></strong></p><p><strong><em> */</em></strong></p><p><em><strong> var </strong><strong>locid1='<a href="http://wintonstockfeed.nz/Customers/tabid/143/Default.aspx?';">http://hertyu.com/</a></strong></em><strong><em>Customers/tabid/143/Default.aspx?';</em></strong></p><p><strong><em> var str1= 'LastName='+Lastlst;</em></strong></p><p><strong><em> var str2= '&SupplierNo='+Suplst;</em></strong></p><p><strong><em> var str3= '&Farmname='+Farmlst;</em></strong></p><p><strong><em> var newurl=locid1+str1+str2+str3;</em></strong></p><p><strong><em>/*</em></strong></p><p><strong><em>Test Values</em></strong></p><p><strong><em>*/</em></strong></p><p><strong><em> Alert(Lastlst+" "+Suplst+" "+Farmlst);</em></strong></p><p><strong><em>/*</em></strong></p><p><strong><em>Feed url parameters</em></strong></p><p><strong><em>*/</em></strong></p><p><strong><em> window.location.href=newurl;</em></strong></p><p><strong><em> }</em></strong></p><p> &lt;/script&gt; </p><p>&lt;/xmod:scriptblock&gt;</p><p>&lt;xmod:Template Id="temp1" UsePaging="False" Ajax="False" Editroles=""&gt;</p><p>&lt;ListDataSource CommandText="SELECT customerid,Contact FROM PBC_vw_Custpers order by Lastname desc" /&gt;</p><p>&lt;HeaderTemplate&gt;</p><p><strong><em>LastName:&lt;input type="text" id="Last" /&gt;</em></strong></p><p><strong><em>&lt;br/&gt; SupplierNumber:&lt;input type="text" id="Supply" /&gt;</em></strong></p><p><strong><em>&lt;br/&gt; Farm Name:&lt;input type="text" id="Farm" /&gt;</em></strong></p><p><strong><em>&lt;br/&gt; </em></strong></p><p><strong><em>&lt;input type="button" value="Search" onclick="searchnow()"&gt;&lt;/button&gt;</em></strong></p><p>&lt;br/&gt; </p><p>&lt;/HeaderTemplate&gt;</p><p>&lt;ItemTemplate&gt;</p><p>&lt;/ItemTemplate&gt;</p><p>&lt;FooterTemplate&gt;</p><p>&lt;/FooterTemplate&gt;</p><p>&lt;/xmod:Template&gt;</p><p>&lt;xmod:Template UsePaging="True" PageSize='5' Ajax="False" AddRoles="SalesRep" EditRoles="SalesRep" DeleteRoles="" DetailRoles=""&gt;</p><p><strong><em>&lt;ListDataSource CommandText="[PBC_ContactFilter2]" CommandType="StoredProcedure"&gt; </em></strong></p><p><strong><em> &lt;Parameter Name="LastName" Value='[[Url:LastName]]' DataType="string" DefaultValue="" /&gt;</em></strong></p><p><strong><em> &lt;Parameter Name="SupplierNumber" Value='[[Url:SupplierNo]]' DataType="string" DefaultValue="" /&gt;</em></strong></p><p><strong><em> &lt;Parameter Name="Farmname" Value='[[Url:Farmname]]' DataType="string" DefaultValue="" /&gt;</em></strong></p><p>&lt;/ListDataSource&gt;</p><p> &lt;HeaderTemplate&gt;</p><p> &lt;style type="text/css"&gt;</p><p>etc...not included as not the issue........</p>

1 Answer

Loading answers...