html form question! help!

Discussion in 'Personal and Professional Photography Websites' started by ironsidephoto, May 17, 2007.

  1. ironsidephoto

    ironsidephoto TPF Noob!

    Joined:
    Oct 22, 2006
    Messages:
    337
    Likes Received:
    0
    Location:
    Arkansas
    Can others edit my Photos:
    Photos NOT OK to edit
    so here's the deal.

    i'm trying to add a purchasing form to my site.
    basically, a person fills out the form, the info is emailed to me, and i send them a paypal invoice.

    the question is: how do i add some sort of thing to be able to purchase more than one photo per form? maybe somehow clicking an 'add another photo' sort of button that adds another section of the form automatically?

    look at the site home>purchasing and you'll get a better idea of what i mean.
     
  2. eravedesigns

    eravedesigns TPF Noob!

    Joined:
    Feb 19, 2006
    Messages:
    624
    Likes Received:
    0
    Can others edit my Photos:
    Photos NOT OK to edit
    If I were you I would consider buying a script that ads a shopping cart type of thing to your site or just build your website off of a script like ecommerce. These scripts have a bunch of templates out there or you could get someone to code a design to work with it but ecommerce is one of the more popular scipts out there. Also try www.hotscripts.com for some free and good scripts maybe you can find one that will work.
     
  3. ironsidephoto

    ironsidephoto TPF Noob!

    Joined:
    Oct 22, 2006
    Messages:
    337
    Likes Received:
    0
    Location:
    Arkansas
    Can others edit my Photos:
    Photos NOT OK to edit
    if you look at my galleries, you'd see that those ecommerce things won't go with the flow of the site. i like my flash galleries, and would like to just be able to have people buy a picture by knowing it's number in the gallery.
     
  4. Alpha

    Alpha Troll Extraordinaire

    Joined:
    Mar 15, 2005
    Messages:
    5,454
    Likes Received:
    41
    Location:
    San Francisco
    Can others edit my Photos:
    Photos NOT OK to edit
  5. ironsidephoto

    ironsidephoto TPF Noob!

    Joined:
    Oct 22, 2006
    Messages:
    337
    Likes Received:
    0
    Location:
    Arkansas
    Can others edit my Photos:
    Photos NOT OK to edit
    so i was messing around with it and now when the form e-mails, there isn't anything in the text. will someone look at the source and tell me why?
    this is tricky business.
     
  6. mr e

    mr e TPF Noob!

    Joined:
    Oct 21, 2006
    Messages:
    94
    Likes Received:
    0
    Can others edit my Photos:
    Photos OK to edit
    It probably has something to do with your form action being "http://www.hostmonster.com/monstermail", I haven't used their service (or whatever it is) so I wouldn't know specifics, but my guess is it's them.

    Personally I would look into a simple PHP form email script, then you could customize i however you wanted.
     
  7. ironsidephoto

    ironsidephoto TPF Noob!

    Joined:
    Oct 22, 2006
    Messages:
    337
    Likes Received:
    0
    Location:
    Arkansas
    Can others edit my Photos:
    Photos NOT OK to edit
    (i don't know that much about html)

    the monstermail is just the e-mail service my hosting has. that forwards the info to my webmaster e-mail.
    i'm not talking about the e-mailing of the info, just how to add more lines to purchase pictures by clicking a sort of 'add another line' button.
    know what i'm talking about??

    come on tpf, these are some of the weakest responses i've ever gotten!

    as soon as i finish this form then my website will be COMPLETE!
    muahaha.
     
  8. mr e

    mr e TPF Noob!

    Joined:
    Oct 21, 2006
    Messages:
    94
    Likes Received:
    0
    Can others edit my Photos:
    Photos OK to edit
    Well if you want to have a truly infinite amount of possible text boxes, you'll want to look into Javascript and adding elements to the DOM, then you'll want to write a function to dynamically name and append these new fields

    Another less scalable way would be to put in for example 10 extra fields that all start hidden, then use JS to display them one by one when the user clicks add another field
     
  9. ironsidephoto

    ironsidephoto TPF Noob!

    Joined:
    Oct 22, 2006
    Messages:
    337
    Likes Received:
    0
    Location:
    Arkansas
    Can others edit my Photos:
    Photos NOT OK to edit
    i wish i knew how to do that. any tips would be helpful.
     
  10. mr e

    mr e TPF Noob!

    Joined:
    Oct 21, 2006
    Messages:
    94
    Likes Received:
    0
    Can others edit my Photos:
    Photos OK to edit
    Here's something simple (by the way, TPF needs the
    Code:
     tag so this would look normal)
    
    Play around with this example and see what you can extrapolate from it, and if you run into problems feel free to ask, I remember first learning Javascript, and it *sucked*, it's just not a friendly language to learn
    
    Javascript
    <script type="text/javascript">
    var i = 1;
    function showNext()
    {
         document.getElementById('text' + i).style.display = 'block';
    
         i++;
    }
    </script>
    
    HTML
    <input type="text" name="text" id="text" value="" />
    <input style="display: none;" type="text" name="text1" id="text1" value="" />
    <input style="display: none;" type="text" name="text2" id="text2" value="" />
    <input style="display: none;" type="text" name="text3" id="text3" value="" />
    <input type="button" onclick="showNext();" value="Add" />
     

Share This Page