|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi, Rookieboy here. I am trying to create a simple text box where peole can enter information and have it sent to me via e-mail. In Netscape it includes this in the body of the e-mail:
comment=what+is+wrong+here It IE nothing is submitted in the e-mail. What am I doing wrong? You might have seen this problem before. If you want I can supply the html used. |
|
#2
|
||||
|
||||
|
What are you using to send the email? How did you make this form? The code you use to send the email and collect the text could be helpful, but please put it in code tags, so it is easier to read.
|
|
#3
|
|||
|
|||
|
Hi, thanks for getting back to me. I am using plain simple tags. see below. I don't know how to make forms and have been serching for information on how. Below are the tags.
<body> <form action="mailto:dana.gagnon@comcast.net" method="POST"> <textarea cols="50" rows="4" name="comment"></textarea> <br> <input type="submit" value="Submit"> <input type="reset"><br> </form> I don't know if thjis will show as text so I attached a txt file. |
|
#4
|
|||
|
|||
|
The following is a snippet of code that creates a form with a name, email, and comment field. Just put your email where it says YOUR EMAIL, and you'll be set to go!
Code:
<form action="mailto:YOUR EMAIL" method="post" enctype="text/plain"> <table width="80%" border="0" cellspacing="0" cellpadding="2"> <tr> <td width="35%"> <div align="right"><b>Name:</b></div> </td> <td width="65%"> <input type="text" name="name" size="15"> </td> </tr> <tr> <td width="35%"> <div align="right"><b>Email:</b></div> </td> <td width="65%"> <input type="text" name="email" size="20"> </td> </tr> <tr> <td width="35%"> <div align="right"><b>Comment:</b></div> </td> <td width="65%"> <textarea name="comment" cols="25" wrap="virtual" rows="3"></textarea> </td> </tr> <tr> <td width="35%"> </td> <td width="65%"> <input type="submit" name="Submit" value="Submit"> <input type="reset" name="reset" value="Reset"> </td> </tr> <tr> <td width="35%"> </td> <td width="65%"> </td> </tr> </table> </form> |
|
#5
|
|||
|
|||
|
One more thing in case you want to understand : ):
The action field is what the form should do when submitted. Since this will be sent to an email address, all you need is the mailto action followed by the address. The enctype is how the information should be encoded. If you want to be able to read the information clearly within your mail client, you should make sure this is set to "text/plain". Otherwise it will come out as one long line. For this: Code:
<INPUT TYPE="submit" NAME="Submit" VALUE="Submit"> Make sure the TYPE is set to 'submit'. This can also be "reset" if you would like a button that resets the form. The name is how this will show up in your mailbox. The Value is how the button will read on the screen. For example, you could label it "Click It" or "Send It". Once you have completed these steps, close off the FORM with a </FORM> and you are all set to go. When someone fills out the form, it will appear like this in your email: name=Rookieboy email=rookie@rookie.com comment=Thanks for telling me how to do this! Submit=Submit |
|
#6
|
||||
|
||||
|
That method will work for simply mailing the info, however, if you ever want to do more with the data from the form, you'll want to look into a server-side option, like PHP or ASP, and make a form handler page, which would then be used as the "action".
You can find more about that by reading up on PHP (open source) or ASP (microsoft), if you are interested. |
|
#7
|
|||
|
|||
|
Thanks Hockey, but I am still getting mixed info in the mail program. I am using netscape because I know it doesn't handle things as well as IE, and when I hit submit it runs the Netscape e-mail with this in the body:
name=Dana email=dana.gagnon@comcast.net comment=testing e-mail Submit=Submit why? Is there a way to have it just submit the info without running the e-mail program? |
|
#8
|
|||
|
|||
|
I use comcast, and I am hoping for a local form, thier sit where I can access the cgi bin is having problems.
|
|
#9
|
|||
|
|||
|
As karsh 44 previously stated, to do more with the form you are going to need way more than just basic html. You are going to have to look at using php or another lanuage to make the form do more things with the data. At devshed, there are numerous php tutorials and all over the WWW there are millions of php tutorials....i recommnd to buy a book and start learning.
|
|
#10
|
|||
|
|||
|
Well, you could use any form processor on the WWW to do the job for you. It just depends if you wish to pay for it or not.
![]() |
|
#11
|
|||
|
|||
|
Thats what I thought but wasn't sure. Thanks. for your help.
|
|
#12
|
||||
|
||||
|
Well, before you try learning anything, be sure you see what comcast supports. Not all providers give you php or asp or other languages. You mentioned something about a cgi? If you find that your host does support php or asp, search google for "sending email with asp" or php. There's lots out there.
I would really recommend that you utilize something like this if you can, rather than submitting to the email. As to the results you got with hockey's code, that is what should happen. You can modify the contents to whatever you need. |
|
#13
|
|||
|
|||
|
Ok, 2 more small questions then I am done. With IE, when I enter information and submit, it opens my outlook express mail program but there isn't any thing in the mssg and nothing comes accross. Do you know why?
Is there a way with basic html that when the submit button is hit and it sends that it will open to a different page? I know that a thank you page requires other languages, is there a local html tag I can use for some rerounting? Right now it stays the same with all the information still in the textbox. I will look into comcast and read up some more. Thanks again for all your time! |
|
#14
|
|||
|
|||
|
np for the help man. Good luck!
![]() |
|
#15
|
||||
|
||||
|
1. I don't know why it would open outlook. When I run the code in IE, it just sends the mail.
2. You can use the meta-refresh tag to redirect users, but it uses a timer, not the submission of the form. There can only be one form action per submit, so I don't know that you can do it with just html. Really, I think you're going to have to see what server-side language comcast supports. If they have asp, come see me in the asp forum, and I'll help you do this right . If they support PHP, there are lots of people who can help you in the php forum. You definitely want to do it this way, not with just html. Good luck ![]()
__________________
--Dave-- U2kgSG9jIExlZ2VyZSBTY2lzLCBOaW1pdW0gRXJ1ZGl0aW9uaXMgSGFiZXM= |
![]() |
| Viewing: Dev Shed Forums > Other > Beginner Programming > Forms, creating and posting error |
| Thread Tools | Search this Thread |