Web Analytics Made Easy -
StatCounter Forms with arrays - CodingForum


No announcement yet.

Forms with arrays

  • Filter
  • Time
  • Show
Clear All
new posts

  • Forms with arrays

    I use a form that has several list fields, and the selections are populated through arrays.

    Is it correct to assume that in order to have the users responses posted back to me, I need to have a database folder in the root or housed with the server?

    If so, is there some way of coding the select fields to avoid this?

    Thanks for any help.

  • #2
    As this is the client-side JavaScript forum I will give you the client-side Javascript answer. It is possible to have the form submitted to you using client-side javascript and email. When the form is submitted it sends an email to you with the form data. Often times a popup will warn the user that the information is being submitted by email.

    If you do not want to have the info emailed to you in this manner you will have to use a server-side language.


    • #3
      Hello John,

      I'd be happy to have the form submitted an posted back to me in the manner you mentioned. Are there any tutorials that you know of that would show me how to accomplish having the users choices from select lists that are populated through arrays posted back to me?

      Thanks for your response.


      • #4
        Sure, the key is to set up your form tag correctly:

        <form method="post" action="mailto:[email protected]" enctype="text/plain">

        Of course you would replace all the xxx stuff with the email address you would like to send to. Upon subbmission, the data that was entered into the form and seleceted by the user will be emailed to you.

        For a full blown tutorial see:


        • #5
          Dang, he beat me to it. I always recommend that tutorial.

          P.S. They also have an example javascript formatting method at the bottom of that page; however there IS a problem with that method though regarding Microsoft Outlook/Outlook Express that I ran into if the script or message gets to be too long...

          Anyway post back if you run into any problems. If you do, you might find it easier to just post the whole email as John Krutsch suggested:

          action="mailto:[email protected]" enctype="text/plain"

          in the form tag, instead of the javascript route they have as an example. It's uglier, but it gets the job done.
          Former ASP Forum Moderator - I'm back!

          If you can teach yourself how to learn, you can learn anything. ;)