Link to home
Start Free TrialLog in
Avatar of brianbish
brianbish

asked on

How do I pass an array via HREF using document.getElementById().value

How do I pass an array via HREF using document.getElementById().value and an Onclick event?
<script language="javascript" type="text/javascript">
function subcatid(x) {
var var1=x;
window.location.href = ( 'manage_products.php?var1='+var1);
}
</script>
<html>
<body>
<table> 
<tr>
                                    <td >Image 1: <input size="40" type="file" name="file[]" id="image1"/>									</tr>
                                        <tr>
 
                                      <td >Image 2:
 
                                      <input size="40" type="file" name="file[]" id="image2" /></td>
                                    </tr>
 
                                    <tr>
 
 
                                      <td >Image 3:
 
                                      <input size="40" type="file" name="file[]" id="image3" /></td>
                                    </tr>
 
                                    <tr>
 
                                      <td >Image 4:
 
                                      <input size="40" type="file" name="file[]" id="image4" /></td>
                                    </tr>
 
                                    <tr>
 
                                      <td >Image 5:
 
                                      <input size="40" type="file" name="file[]" id="image5" /></td>
                                    </tr>
 
                                    <tr>
 
                                      <td >Image 6:
 
                                      <input size="40" type="file" name="file[]" id="image6" /></td>
                                    </tr>
 
                                    
                                     
</table>
  <input name="submit" type="button" value="Add"  onclick="subcatid(file[])"/>
 
</body>
</html>

Open in new window

Avatar of ChetOS82
ChetOS82
Flag of United States of America image

What you are asking for doesn't make sense.  What are you trying to accomplish?
SOLUTION
Avatar of hielo
hielo
Flag of Wallis and Futuna 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 brianbish
brianbish

ASKER

Can I do this inside the html:

<script>
var im1=file[0];
var im2=file[1];
var im3=file[2];
var im4=file[3];
var im5=file[4];
var im6=file[5];
</script>

<input name="submit" type="button" value="Add"  onclick="subcatid(im1, im2, im3, im4, im5, im6 )"/>
 


ASKER CERTIFIED SOLUTION
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