Link to home
Start Free TrialLog in
Avatar of ninteen83
ninteen83Flag for Qatar

asked on

Selecting multi Documents from a View [Web]

Hi Experts

I'm not new to Domino and html but got very less ideas in javascript as I feel this can be solved from js. Need ur help in this case.

I have a form with an embedded view (displaying as HTML). View has a list of tools. I want to select multiple tools from the list (by checkboxes) and pass their 'ToolID' to a field e.g. 'RequestedToolsIds' in the form.

Please guide me with the code how can I

1. create checkboxes for each tools (documents) in the view, pass selected Tool Ids (e.g. 101, 103, 104) to RequestedTools field of form, by clicking on Submit.
2. generate a Request No (from profile or another document) and assign the Request No to selected documents' field 'RequestNo'.

waiting for ur response
thanks in advance
ASKER CERTIFIED SOLUTION
Avatar of Sjef Bosman
Sjef Bosman
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ninteen83

ASKER

Hi bosman

I have done it in this way:

created a column with following text in view

"[<input type=\"checkbox\" name=\"Tool\" value=\""+ToolID+"\" onClick='AddTool()'>]"

Inserted below js script in the form that has embedded view

function AddTool()
{
      var len=window.document.forms[0].Tool.length;
      window.document.forms[0].RequestedTools.value="";
      for(var a=0;a<=len-1;a++)
      {
      if(window.document.forms[0].Tool[a].checked)
        {
            window.document.forms[0].RequestedTools.value+=window.document.forms[0].Tool[a].value+";";
        }            
      }
}
Clever!