Email a text field with submit button


(kostas) #1

Hi i want to have a standar multiline text field which the user can fill with a answer. Then i want to press a submit button to send the answer as an email to me…
text field code:

<!DOCTYPE html>
<html>
<head>
<title>Multiple-Line Input Control</title>
</head>
<body>
<form>
Description : <br />
<textarea rows="5" cols="50" name="description">
Enter description here...
</textarea>
</form>
</body>
</html>

submit button

<a href="mailto:abc@example.com?subject=Feedback&body=Message"> Submit</a>

Can someone help me how to connect these lines of code??? Thank you.


#2

By using mailto: It will open the user’s default mail program and fill in the information that they have completed in the textfield they will still have to send it like they would a normal email. They can then change all the other information like the recipient address, subject, etc. Is this what you require? or are you looking to send the information from the webpage. IF this is the case then you would need to use a server side language, e.g PHP or ASP. These languages provide a way to send e-mails. There are probably a few examples here on the forum that show ways to do this.

By the way. The code above does not show because you need to highlight it in your message and click the button to format it as code.


(kostas) #3

first of all thank you for the answer…I want to use the second way you describe but i didnt realized it will involed a server etc…I dont want to open email client so it will be more clean and fast…i will look the forum …


#4

Where are you using this Hype document? Is it on an existing web page? If it is then the server side language is probably available. All you would need is to add 1 file with a little bit of language that will collect the information and send it to an address you specify.


(kostas) #5

it will be included in a quiz and i want the student to send the answer to me with a submit button. I can use google forms but i want sth clean and fast as i told you…


#6

But where is the document?? on a web page?


(kostas) #7

no in a widget to place inside in an ibooks author document


(Mark Hunte) #8

This may be useful from About HTML widget creation in iBooks Author

Posting to external Web Services

HTML widgets can only post to external web services if those web services have implemented the appropriate Cross-Origin Resource Sharing (CORS) headers.
http://enable-cors.org/


#9

You can also use subject= and body= to add a subject to the email and insert a bit of text.