Passing selected docid to a opendialog box on the web

I can’t seem to get pass the unid of a selected document from a embedded view from the web. I need to pass the unid to a dialog box changes some fields and then process the selected documents in the backend. Any ideas? Here’s the code.

I can see the unid in the alert box but I don’t know how to pass them to the dialog box via javascript.

var cb = document.forms[0].$$SelectDoc;

// find the first checked document . . .

var selectcount = 0;

var docUNID = new Array();

for(i = 0; i < cb.length; i ++){

if (cb[i].checked){

docUNID[selectcount] = cb[i].value;

selectcount++;

}

}

/////////////////////////////////////////////////////////////////

if (docUNID[0] == null ){

alert(‘You did not select any documents, please correct and try again.’);

}

else {

if (docUNID != null ){

result=window.confirm(‘You are going to process the selected documents, click OK if you wish to proceed.’);

if (result==true) {

alert(docUNID)

window.open(“webdialog?OpenForm?unid=docUNID”,“dialog”,“width=400,height=500,top=100,left=250,screenX=250,screenY=50,scrollbars=1,resizable=1”)

Subject: Passing selected docid to a opendialog box on the web

window.open(“webdialog?OpenForm&unid=” + docUNID,“dialog”,“param=value”)

Subject: Javascript

This javascript will require the user to select one and only one doc in a view. When the user selects one doc, its UNID will be assigned to ‘key’.

var f = document.forms[0];

if ( f.$$SelectDoc.checked == undefined ) {

var j = 0;

var k = 0;

for ( i=0; i < f.$$SelectDoc.length ; i++) {

if ( f.$$SelectDoc[i].checked == true ) {

  k = i

  j = j + 1

}

}

if ( j == 0 ) {

alert ( 'Select one document.' );

return false

}

else if ( j > 1 ) {

alert ( 'Select only one document.' );

return false

}

else {

var key = f.$$SelectDoc[k].value

}

}

else if ( f.$$SelectDoc.checked == false ) {

alert ( ‘Select one document.’ );

return false

}

else {

var key = f.$$SelectDoc.value

}

Subject: RE: Javascript

that the problem how do I pass the key to a open.window via javascript. I can get the multiple keys but I need to pass this to a dialog box via javascript.

window.open(“webdialog?OpenForm?”,“dialog”,“width=400,height=500,top=100,left=250,screenX=250,screenY=50,scrollbars=1,resizable=1”)

Subject: Use @Commands instead

Create a button or link with this:

@Command([Folder];“MyFolderName”;“0”);

@Command([ToolsRunMacro];“MyAgentName”)

to put the selected documents into a folder and then run an agent on the documents in the folder. Don’t forget to have the agent remove all the documents from the folder after they’re processed!

Subject: RE: Javascript

Can’t you use something like:window.document.forms[0].fieldname.value=window.opener.document.forms[0].fieldname.value