ASP Get Form with Increasing inputs

Discussion in 'C#' started by sethyr, Feb 4, 2010.

  1. #1
    I'm creating a form to auto generate code for me. With the form I want to be able to choose how many images there will be then for how many i choose it will create that many inputs to type in the filenames, but will also create that many more lines of code (i'm guessing a loop will need to be made).

    Here is what I have so far.

    <form action="" method="get" name="photogallery">
    <label for="imagenumber">How many images?</label>
    <input type="text" name="imagenumber" maxlength="3" width="30" /><br />
    <br />
    <label for="foldername">Folder Name (no spaces)</label>
    <input type="text" name="foldername" /><br />
    <br />
    <label for="filetype">Filetype</label>
    <input type="radio" name="filetype" value=".jpg" checked="true" />.jpg
    <input type="radio" name="filetype" value=".gif" />.gif
    <input type="radio" name="filetype" value=".png" />.png
    </form>
    
    <%
    Dim foldername,filetype,filename
    foldername =  Request.QueryString("foldername")
    filename =  Request.QueryString("filename")
    filetype =  Request.QueryString("filetype")
    
    
    
    Response.Write("<a href=""/nmhs/images/gallery/" & foldername & "/" & filename & filetype & " "" class=""image""><img src=""/nmhs/images/gallery/" & foldername & "/" & filename & "_t" & filetype & " "" />")
    %>
    PHP:
    Sorry about all the ASP questions! I'm creating an asp project and i learn better this way than reading how-to's.

    Thanks.
     
    sethyr, Feb 4, 2010 IP
  2. sethyr

    sethyr Peon

    Messages:
    24
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Oops. I forgot to say that it would increase the "filename" input box, which i forgot to put in the code.
     
    sethyr, Feb 4, 2010 IP
  3. camjohnson95

    camjohnson95 Active Member

    Messages:
    737
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    60
    #3
    You would be better off using javascript to do this, it would reduce the work that the server has to do and be much faster for the user. I can provide some code if you want to go this way, otherwise I'll show you the ASP way...
     
    camjohnson95, Feb 5, 2010 IP
  4. chengary

    chengary Banned

    Messages:
    88
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #4
    Request.form("foldername")
     
    chengary, Feb 21, 2010 IP