Topic: Concatenating value outputs from two radio button arrays

Hello all,

I have tried to solve this problem a number of ways, all unsuccessfull, and I am now back at the stage were I have to begin again so I am seeking your help.

I have two radio button arrays which I want to use to construct a file name and then have a button 'onclick' command that opens that file.

I am finding it difficult writing a function that can retrieve the checked values and retain them until the button 'onclick' event is initiated.

FYI The first array provides the first part of the file name, the second array the second part and then the file extension is added to the file name at the 'onclick' event.

I am hoping someone can suggest a way of picking up these values, concatentating them and then opening the file?

Thanks for taking the time to read this.

Re: Concatenating value outputs from two radio button arrays

Hello all,
Sorry should have posted the code - see below.

Note I have made some progress since the last post and managed to get the array values concatenated however I now find that I cannot create an onclick function to open the file - Access Denied message.

I would appreciate it if someone can assist.

Code is below.

Regards & thanks.


<!-- saved from url=(0022)http://internet.e-mail -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<TITLE>ConcatenateArrayValues</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
</style>
<script>
<!-- Begin
var first=""; var second=""; var lod="";
// radio buttons are either/or elements
// MIE evaluates onClick of an element.  NN does not 
function getRadios(what){
// get the color value
j=what.first.length; //alert(j)
    for (i=0; i<j; i++){
        if(what.first[i].checked) var first = what.first[i].value
    }
// get number value
j=what.second.length; //alert(j)
    for (i=0; i<j; i++){
        if(what.second[i].checked) var second = what.second[i].value
    }
//get letter value
j=what.lod.length; //alert(j)
    for (i=0; i<j; i++){
        if(what.lod[i].checked) var lod = what.lod[i].value
    }
// show selections
what.filename.value = (first+', '+second+', '+lod)
}
// End -->
</script>    
</head>
<body>
<table width="100%"  border="0">
   <tr>
    <td width="60%" colspan="3" align="center" valign="top">
            </td>
  </tr>
  <tr>
    <td colspan="3"  align="left">
      </td>
  </tr>
  <tr>
  <form name="myForm">
    <td align="left" valign="top">
            <div onClick='getRadios(document.myForm)' /* clicking division */>
            <input type="radio" name="first" value="ee">ElEng<br>
            <input type="radio" name="first" value="gk">GenKno<br>
            <input type="radio" name="first" value="hv">HVAC<br>
            <input type="radio" name="first" value="ic">ICT Engineering<br>
            <input type="radio" name="first" value="me">MarEng<br>
        </div /* end clicking */><br><br>
        </td>
    <td align="left" valign="top">
        <div onClick='getRadios(document.myForm)' /* clicking division */>
            <input type="radio" name="second" value="_sc">Scope<br>
            <input type="radio" name="second" value="_sp">Specification<br>
            <input type="radio" name="second" value="_de">Design<br>
            <input type="radio" name="second" value="_bu">Build<br>
            <input type="radio" name="second" value="_ac">Accept<br>
        </div /* end clicking */><br><br>
</td>
    <td align="left" valign="top">
    <div onClick='getRadios(document.myForm)' /* clicking division */>
            <input type="radio" name="lod" value="1">LOD 1<br>
            <input type="radio" name="lod" value="2">LOD 2<br>
            <input type="radio" name="lod" value="3">LOD 3<br>
            <input type="radio" name="lod" value="4">LOD 4<br>
        </div /* end clicking */>
<br>
<b>My FileName Values:</b>
<input type=text name="filename" size=30><br><br>
<input type="button" name="GET FILE!" value="Get File!" onclick="getfile()">
</form>
</td>
  </tr>
  <tr>
    <td colspan="3"  align="center" valign="top"></td>
  </tr>
</table>
<table width="100%" >
  <tr>
    <td width="43%" align="center"></td>
    <td width="14%" align="center"></td>
    <td width="43%" align="center"></td>
  </tr>
</table>
<SCRIPT  LANGUAGE="JAVASCRIPT">
var filename=0;
function getfile()
{
window.open (filename) 
}
</SCRIPT>
</body>
</html>

Re: Concatenating value outputs from two radio button arrays

Succeeded with

    window.open(choosetopic()+''+chooseproject()+''+".html");