javascript problem on php
<p>Bellow is my php code . </p>

<pre><code>    &lt;div class="poller"&gt;

                &lt;div class="poller_question" id="poller_question2"&gt;
                &lt;p class="pollerTitle"&gt;Would you join a Community Action Committee?&lt;/p&gt;
&lt;p class="pollerOption"&gt;&lt;input type="radio" value="6" name="vote[2]" id="pollerOption6"&gt;
&lt;label for="pollerOption6" id="optionLabel6"&gt;Yes&lt;/label&gt;&lt;/p&gt;&lt;p class="pollerOption"&gt;
&lt;input type="radio" value="7" name="vote[2]" id="pollerOption7"&gt;&lt;label for="pollerOption7" 
id="optionLabel7"&gt;Maybe&lt;/label&gt;&lt;/p&gt;&lt;p class="pollerOption"&gt;&lt;input type="radio" value="8" 
name="vote[2]" id="pollerOption8"&gt;&lt;label for="pollerOption8" id="optionLabel8"&gt;No&lt;/label&gt;&lt;/p&gt;           
                &lt;a href="#" onclick="castMyVote(2,document.forms[0])"&gt;&lt;imgsrc="images/vote_button.gif" border="0"&gt;&lt;/a&gt;

                &lt;/div&gt;
                &lt;div class="poller_waitMessage" id="poller_waitMessage2"&gt;
                    Getting poll results. Please wait...
                &lt;/div&gt;
                &lt;div class="poller_results" id="poller_results2"&gt;
                &lt;!-- This div will be filled from Ajax, so leave it empty --&gt;&lt;/div&gt;
            &lt;/div&gt;
</code></pre>

<p>Bellow is my javascript code </p>

<pre><code>function castMyVote(pollId,formObj)
{   
    var elements = formObj.elements['vote[' + pollId + ']'];
    var optionId = false;
    for(var no=0;no&lt;elements.length;no++){
        if(elements[no].checked)optionId = elements[no].value;
    }
    Poller_Set_Cookie('dhtmlgoodies_poller_' + pollId,'1',6000000);
    if(optionId){

        var ajaxIndex = ajaxObjects.length;
        ajaxObjects[ajaxIndex] = new sack();
        ajaxObjects[ajaxIndex].requestFile = serverSideFile + '?pollId=' + pollId + '&amp;optionId=' + optionId;
        prepareForPollResults(pollId);
        ajaxObjects[ajaxIndex].onCompletion = function(){ showVoteResults(pollId,ajaxIndex); }; // Specify function that will be executed after file has been found
        ajaxObjects[ajaxIndex].runAJAX();       // Execute AJAX function 

    }   
}   
</code></pre>

<p>form php i call a javascript method named "castMyVote" .The javascript is </p>

<pre><code>var elements = formObj.elements['vote[' + pollId + ']'];
</code></pre>

<p><strong>create problem ? why ?How to solve it?var elements have no value</strong></p>
