Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: arrays help!

  1. #1
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts

    arrays help!

    Hello,
    I'm trying to split up an array to insert into a data base,

    example,
    I'm setup several check boxes on html form,
    and i need to submit them to the db, and have them split so that
    each value uses a new row.

    like
    Friday 4:00PM - 8:00PM, Saturday 8:00AM - Noon, Saturday Noon - 4:00PM, Saturday 4:00PM - 8:00PM, Sunday 8:00AM - Noon, Sunday Noon - Finish

    i need to be able to insert these values one at a time,
    I know i need to use an array to do this, but i can't remember how.

    if some one could show me an example that would be great!

    thanks in advance for your time!
    -Ken

  • #2
    New Coder
    Join Date
    Aug 2002
    Posts
    31
    Thanks
    0
    Thanked 0 Times in 0 Posts
    if they are coming from checkboxes you don't need to split them up at all

    Code:
    <%
    Response.Write Request.Form("r")  & "<hr>"
    for each node in Request.Form("r" )
    
    	'Display each checkbox node one at a time
    	Response.write "<p>" & node & "</p>" 
    next
    %>
    <html>
    <body>
    <form method="post">
    <input type="checkbox" value="a1" name="r">a1</input>
    <input type="checkbox" value="a2" name="r">a2</input>
    <input type="checkbox" value="a3" name="r">a3</input>
    <input type="submit">
    </form>
    </body>
    </html>
    allison


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •