Menu

Setting Select element having onChange attrib

Help
2007-05-12
2013-04-25
  • Dhanraj Muthiyan

    Hi,

    I'm trying to set following select tag

    <select onChange="openOnlineForm(this)" name=select1 class="field1">
    <option value="/pfsuser/uGrad/UGAppliprocess1.htm">Under Graduate
    <option value="/Pfsuser/pGrad/PGAppliprocess1.htm">Post Graduate
    </select>

    Initially I used 'ie-set-select-field' tag. It is setting the required index, where as JavaScript 'openOnlineForm' is not getting called. Then I tried explicitely calling the JavaScript as following.

       <ie-session baseUrl="localhost://staging.com" beginSession="true">
          <ie-set-select-field functionId="Select from a List" name="select1" optionIndex="2"/>
          <ie-execute-javascript functionId="openOnlineForm" script="openOnlineForm.value='select1'"/>
       </ie-session>

    Still the script is not getting called. Am I missing something? Or I'm incorrectly handling the Select element?

    Following is the simple code of the JavaScript function.

    function openOnlineForm(path)
    {
    window.location=path.options[path.selectedIndex].value;
    }

    Thanks in anticipation.

    Regards.

    Dhanraj

     

Log in to post a comment.