hcl-bot
February 17, 2005, 2:17am
1
Hi,
i had created a radio button in a view collumn with follwing formula.
unid:=@Text(@DocumentUniqueID );
“[<INPUT TYPE=radio NAME="$$SelectDoc" VALUE=”+unid+“>]”
The view is categorized and is called through viewtemplate default form. In my veiw tempalte form I had a graphic button with onclick event:
server=window.document.forms[0].Server_Name.value;
dbpath = window.document.forms[0].DBPath.value;
if(document.forms[0].$$SelectDoc.checked){
parent.location=“http://”+server+“/”+dbpath+“/”+“bidding?openform&unid=”+document.forms[0].$$SelectDoc.value
}
else
{
alert(“test”);
}
I want to pass the doc id for which radio button is selected. But It only work for wehen i click the radio button for the first document in the view and click on graphic button the doc id is passed but if i select other radio button and click the graphic button the doc id is not passed
hcl-bot
February 17, 2005, 6:21am
2
Subject: Passing Docid in query string - lotus Gurus Help
Please check below Functionfunction OpenDoc()
{
var doc=“y”;
len=document.forms[0].$$SelectDoc.length;
alert("Size of the Radio is "+len);
for (i = 0; i <len; i++) {
if (document.forms[0].$$SelectDoc[i].checked) {
doc = document.forms[0].$$SelectDoc[i].value;
alert ("Select Doc Value" +doc);
}
}
if (doc ==“y”) {
alert(“Please select the doc”);
}
else {
parent.location=“/Test_R.nsf/0/”+doc+“?OpenDocument”;
}
}
hcl-bot
February 17, 2005, 5:25am
3
Subject: Passing Docid in query string - lotus Gurus Help
with your code you get the first input field of your radio buttons…
Try this (maybe you have to modify, its not tested):
var fields = document.getElementsByName(“$$SelectDoc”);
var i=0;
var value= “”;
while(value= “” && i < fields.length) {
if(fields[i].checked)
value = fields[i].value;
i++;
}
parent.location=“http://”+server+“/”+dbpath+“/”+“bidding?openform&unid=”+value