Issue with using jQuery to get hidden form field value in Firefox
<p>I have the following form and I am trying to get the value of the hidden form field "kpiValueType" when I click the next button.</p>

<pre><code>&lt;script type="text/javascript"&gt;
    function getGivenFieldValue()
    {
        var searchFieldVal = jQuery('input:hidden[name="activities[0].kpiList[0].kpiValueType"]').val();
        alert(searchFieldVal);
    }
&lt;/script&gt;

&lt;h:form id="fundRequestForm" action="" method="post"&gt;
    &lt;ui:repeat value="#{fundRequestBean.requestActivityList}" var="activity" varStatus="stat"&gt;
        &lt;table width="100%" class="tablesorter"&gt;
            &lt;thead class="fixedHeader"&gt;
                &lt;tr&gt;
                    &lt;th width="418px"&gt;
                            &lt;input type="checkbox" checked="checked" name="activities[#{stat.index}].check" /&gt;
                        #{activity.activityName}
                    &lt;/th&gt;
                    &lt;th&gt;&amp;nbsp;&lt;/th&gt;
                &lt;/tr&gt;
            &lt;/thead&gt;
            &lt;tbody&gt;
                &lt;ui:repeat value="#{activity.kpiList}" var="kpi" varStatus="status"&gt;
                    &lt;tr&gt;
                        &lt;td&gt;#{kpi.kpiName}&lt;ui:fragment rendered="#{kpi.required=='true'}"&gt;
                                &lt;label style="color: red"&gt;*&lt;/label&gt;
                            &lt;/ui:fragment&gt;
                        &lt;/td&gt;
                        &lt;td&gt;&lt;div style="text-align: left; padding-top: 5px; padding-bottom: 5px; float: left;"&gt;
                                &lt;input type="text" name="activities[#{stat.index}].kpiList[#{status.index}].kpiValueString"
                                        value="#{kpi.kpiValueString}" size="60" maxlength="50" /&gt;
                        &lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;input type="hidden" name="activities[#{stat.index}].kpiList[#{status.index}].kpiValueType"
                        value="#{kpi.kpiValueType}" /&gt;
                &lt;/ui:repeat&gt;
            &lt;/tbody&gt;
        &lt;/table&gt;
    &lt;/ui:repeat&gt;

    &lt;table width="100%" border="0" bordercolor="#CCCCCC" rules="none" cellspacing="0" cellpadding="0"&gt;
        &lt;tr&gt;
            &lt;td colspan="3" align="center"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/td&gt;
            &lt;td&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/td&gt;
            &lt;td align="right"&gt;&lt;div id="nextButtonDiv" style="float: right;"&gt;
                    &lt;h:commandButton
                        onclick="getGivenFieldValue()"
                        actionListener="#{fundRequestBean.saveFundRequest}" action="#{fundRequestBean.getPreviewFundRequestData}"
                        value="#{msg.nextLbl}"&gt;
                    &lt;/h:commandButton&gt;
                &lt;/div&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td colspan="3" align="center"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&lt;/td&gt;
        &lt;/tr&gt;
    &lt;/table&gt;
&lt;/h:form&gt;
</code></pre>

<p>From the page source I saw the name of the hidden field kpiValueType as </p>

<pre><code>&lt;input type="hidden" name="activities[0].kpiList[0].kpiValueType" value="N" /&gt;
</code></pre>

<p>The alert gives me undefined. Could you please tell me whats wrong here? I am using jQuery 1.7 and Firefox 13.0.1</p>
