Note that there are some explanatory texts on larger screens.

plurals
  1. POGet field from SQL Server Reporting Services Page
    text
    copied!<p>I'm trying to access a drop down box from a page created by SQL Server Reporting Services using JavaScript. I would normally just getElementById but the the id and name attributes for the drop down element are generated by the server so I don't want to use that to reference the element. i.e. If the design of the page changes in the future it'll name that elements _ct105 or _ct107</p> <p>The only thing I specify on the page is the label "Business Period." I was thinking of using xpath to reference that span then use a relative location to the next select element but I can't figure out how to do that.</p> <p>Ideally, I'd be able to specify the id or name (or any other attribute) of the Select element itself. Is this possible?</p> <p>I'll be using jQuery on the page so if anyone can think of a good way to find it that way it'd be great.</p> <pre><code>&lt;tr IsParameterRow="true"&gt; &lt;td class="ParamLabelCell"&gt; &lt;span&gt;Business Period&lt;/span&gt; &lt;/td&gt; &lt;td class="ParamEntryCell" style="padding-right:0px;"&gt; &lt;div&gt; &lt;select name="ctl140$ctl00$ctl03$ddValue" id="ctl140_ctl00_ctl03_ddValue"&gt; &lt;!-- This is the select box I want --&gt; &lt;option value="0"&gt;&amp;lt;Select&amp;nbsp;a&amp;nbsp;Value&amp;gt;&lt;/option&gt; &lt;option value="1"&gt;Customer&lt;/option&gt; &lt;option value="2"&gt;Previous&amp;nbsp;Week&lt;/option&gt; &lt;option value="3"&gt;Current&amp;nbsp;Week&lt;/option&gt; &lt;option value="4"&gt;Next&amp;nbsp;Week&lt;/option&gt; &lt;/select&gt; &lt;/div&gt; &lt;/td&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload