cancel
Showing results for 
Search instead for 
Did you mean: 

Using JavaScript in the forms-- Activiti

sunil1
Champ in-the-making
Champ in-the-making
Hi,

I have a form, in that i created a dropdown list element and then i used javaScript to add the options to the dropdown list  dynamically(i get the values from the previous stage of the workflow).But when i run , i found an error that my javascript can not able to get the element(document.getElementById is null). Can anyone help me with the issue,

<h1>Email Notification</h1>
<table>
  <tr>
    <td>
      <label>
        Employee Email ID:<br/>
        <input type="text" name="email" id="email" value="@tomaxx.de"/>
        <input type="text" name="user" id="user" value="${user1}"/>
        <select name="combo" id="combo" >
        <option value="text">please slect</option>
        </select>
      </label><br/>
    </td>
  </tr>
</table>
<script language="javascript" type="text/javascript">
    var userString=${user1}.toString();
    var mySplitString=userString.split(",");
    for(var i=0;i<mySplitString.length;i++){
     var opt = document.createElement("option");
     opt.text=mySplitString;
      opt.value=i;
       document.getElementById('combo').innerHTML.options.add(opt);
    }
</script>
1 REPLY 1

kpagratis
Champ in-the-making
Champ in-the-making
I'm having the same problem.  Did you find a workaround?