#1
  1. PHP & Java Error Master
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Jun 2003
    Location
    My Computer
    Posts
    1,219
    Rep Power
    0

    Passing an array via form


    Is this how you'd send an array through a form?
    Code:
    	<form action="do_del.jsp" method="post">
    	<input type="hidden" name="del_vals[]" value="<% out.println(del_ids); %>">
    	<input type="hidden" name="delete" value="delete">
    	<input type="submit" name="sub" value="Delete">&nbsp;&nbsp;
    	<input type="button" name="no" value="No, Go Back" onClick="javascript:history.back()">
    </form>
    
    .. on submition page ..
    
    String[] delete_ids = request.getParameterValues("del_vals");
  2. #2
  3. No Profile Picture
    Moderator =(8^(|)
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Feb 2002
    Location
    Sacramento, CA
    Posts
    1,710
    Rep Power
    14
    Code:
    <form action="do_del.jsp" method="post">
    <%
       for ( int i = 0; i < del_ids.length; i++ ) {
    %>   <input type="hidden" name="del_vals" value="<%= del_ids[i] %>">
    <%
       }
    %>
    </form>
    -james

IMN logo majestic logo threadwatch logo seochat tools logo