not able to resolve form.all_skill is undefined in javascript
<p>My javascript code is </p>

<pre><code>function addTaskSkill(form) {
    var at = form.all_skill.length -1;

    var td = form.task_skill.length -1;
    var tasks = "x";



    if(td&gt;=0 &amp;&amp; form.task_skill.options[0].value==skll_id){
        form.task_skill.options[0] = null;
        td = form.task_skill.length -1;
    }


    for (td; td &gt; -1; td--) {
        tasks = tasks + "," + form.task_skill.options[td].value + ","
    }


    for (at; at &gt; -1; at--) {
        if (form.all_skill.options[at].selected &amp;&amp; tasks.indexOf("," + form.all_skill.options[at].value + ",") == -1) {
            t = form.task_skill.length
            opt = new Option(form.all_skill.options[at].text, form.all_skill.options[at].value);
            form.task_skill.options[t] = opt
        }
    }

    //checkForTaskSkill(form.task_skill);
}

function removeTaskSkill(form) {
    td = form.task_skill.length -1;

    for (td; td &gt; -1; td--) {
        if (form.task_skill.options[td].selected) {
            form.task_skill.options[td] = null;
        }
    }

}
</code></pre>

<p>And My calling function is </p>

<pre><code>&lt;form action="#" method="post" name="detailFrm"&gt;
    &lt;table&gt;
        &lt;tr&gt;
            &lt;td&gt;
                &lt;select name="all_skill" size="10" class="span5" multiple="multiple" &gt;  
                    &lt;option value="30"&gt;Apache&lt;/option&gt;  
                    &lt;option value="31"&gt;Microsoft IIS&lt;/option&gt;
                    &lt;option value="32"&gt;Tomcat&lt;/option&gt; 
                    &lt;option value="34"&gt;JBoss&lt;/option&gt;   
                    &lt;option value="35"&gt;BEA WebLogic&lt;/option&gt;
                &lt;/select&gt;
            &lt;/td&gt;
            &lt;td&gt;&lt;input type="button" class="btn" value="&amp;gt;" onclick="javascript:addTaskSkill(document.detailFrm)" /&gt;
                &lt;br&gt;&lt;br&gt;&lt;input type="button" class="btn" value="&amp;lt;"
                               onclick="javascript:removeTaskSkill(document.detailFrm)" /&gt;&lt;/td&gt;
            &lt;td&gt;
                &lt;select name="task_skill" class="span5" size="10" multiple="multiple"&gt; &lt;/select&gt;
            &lt;/td&gt;
        &lt;/tr&gt;
    &lt;/table&gt;
&lt;/form&gt;
</code></pre>

<p>Here i am selecting some option from one selectbox &amp; on clicking <code>&gt;&gt;</code> it should push to next selectbox. the error i am getting is </p>

<pre><code>TypeError: form.all_skill is undefined
[Break On This Error]   

var at = form.all_skill.length -1;
</code></pre>

<p>I am not getting the solution for this. Please help here to get the solution. i am trying to make a listbox swapper.</p>

<p>Thanks in advance.</p>
