Results 1 to 2 of 2

Thread: Dynamic form

  1. #1
    Join Date
    Feb 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Dynamic form

    Hello all,

    I would like to create a form on my internet page with a dymanic output.
    The user can chose between 5 checkboxes.
    Then the user has to press the submit button.
    After submit the pdf files will appear corresponding to the checked checkboxes. (either underneat or with a popup)
    I am not sure if this can be done in dhtml.

    Thanks in advance for helping me out.

    Best regards,
    Jasper

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Code:
    <form action="pdf1.pdf" onsubmit="for(var i = 0, e = this.elements.files; i < e.length; ++i) if(e[i].checked) window.open(e[i].value); return false;">
      <label>PDF One
        <input type="checkbox" name="files" value="pdf1.pdf">
      </label>
      <label>PDF Two
        <input type="checkbox" name="files" value="pdf2.pdf">
      </label>
      <label>PDF Three
        <input type="checkbox" name="files" value="pdf3.pdf">
      </label>
      <label>PDF Four
        <input type="checkbox" name="files" value="pdf4.pdf">
      </label>
      <label>PDF Five
        <input type="checkbox" name="files" value="pdf5.pdf">
      </label>
      <input type="submit" value="Open">
    </form>
    You'd be better off doing this server-side, though, or even just with normal links. Use this as a supplement to one of those two, not on its own.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Bookmarks

Posting Permissions

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