SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Zealot zompus's Avatar
    Join Date
    May 2006
    Location
    England
    Posts
    133
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Post Multiple forms - One inside another?

    Hey Guys,

    I'm looking to create a little mod for vbulletin that let's me upload an image to my image hosting service.

    http://rafb.net/p/Q03gub67.html - This is the code I'm going to place within vbulletin's templating system. However once done this I get: http://rafb.net/p/pa8H7533.html.

    So the template's basic structure is set out like:
    Code:
    <form>
     Create a new thread form
     <form>
      Image uploading form
     </form>
    </form>
    As you can see I've got one form inside another and this is causing the image uploading form to clash with the create a new thread form.

    Now what I'd like to know is is there a work around to this? Can A form be put inside another and still work? Am I doing something wrong?

    Any help given will be much appreciated.

    Thanks,
    Dan

  2. #2
    SitePoint Wizard bronze trophy C. Ankerstjerne's Avatar
    Join Date
    Jan 2004
    Location
    The Kingdom of Denmark
    Posts
    2,702
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    The problem is, af far as I recon, that your SUBMIT-button will not know which form it is a part of. You can probably make a Javascript-solution, though that wouldn't be advisable in terms of accessibility, but I don't think that one FORM is allowed inside another.
    I would place the second FORM below the first, or incorporate the two forms into each other (i.e. if the server received information in the image path INPUT field, it will not submit the post, but rather generate a new submit page with the text already inputted in the text fields).
    Christian Ankerstjerne
    <p<strong<abbr/HTML/ 4 teh win</>
    <>In Soviet Russia, website codes you!

  3. #3
    In memoriam gold trophysilver trophybronze trophy Dan Schulz's Avatar
    Join Date
    May 2006
    Location
    Aurora, Illinois
    Posts
    15,478
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I concur. Place the second form below the first, that way the submit buttons know which form's data to submit.

  4. #4
    SitePoint Zealot zompus's Avatar
    Join Date
    May 2006
    Location
    England
    Posts
    133
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I know that putting the forms outside one another would do the trick, but the question is how can i get them to work when one is inside the other (there's a reason i'm doing it).

    Do you have an example of this JS you speak of?

  5. #5
    SitePoint Wizard bronze trophy C. Ankerstjerne's Avatar
    Join Date
    Jan 2004
    Location
    The Kingdom of Denmark
    Posts
    2,702
    Mentioned
    7 Post(s)
    Tagged
    0 Thread(s)
    You can submit a form using Javascript, but since it isn't a good idea, because of accessibility, I don't know how to actually do it. Try the Javascript forum.
    Christian Ankerstjerne
    <p<strong<abbr/HTML/ 4 teh win</>
    <>In Soviet Russia, website codes you!

  6. #6
    SitePoint Wizard wheeler's Avatar
    Join Date
    Mar 2006
    Location
    Gold Coast, Australia
    Posts
    1,369
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I didn't actually know it was possible to nest forms inside each other...? I remember trying this a long time ago and ended up running away screaming, with that memory in mind, i've never actually found an absolute need to do it ever since
    Studiotime - Time Management for Web Developers
    to-do's, messages, invoicing, reporting - 30 day free trial!
    Thomas Multimedia Web Development


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
  •