vetri02
vetri02

Reputation: 3299

HTMl text area

If we type something in the text area and press submit button, the values should be displayed on the same page under that. How to do that?

And make stay permanently on the page

Upvotes: 0

Views: 2640

Answers (4)

Jaime Garcia
Jaime Garcia

Reputation: 7096

In order to store something permanently, you need to have a server running your webpage. You can't just create an HTML file that can get changed on the fly and have those changes become permanent. You'll need to learn a server language (PHP for example) and have a server (like Apache) that can display your page.

Is this what you're intending? to make an actual site, not just a webpage?

Upvotes: 1

jantimon
jantimon

Reputation: 38140

You need javascript.

<form onsubmit="document.getElementById('output').innerHTML = document.getElementById('tarea1').value;return false">
<textarea id="tarea1"></textarea>
<input type="submit" />
</form>
<div id="output"></div>

Upvotes: 2

Aaron Digulla
Aaron Digulla

Reputation: 328574

Add a piece of JavaScript and attach it to onClick of the submit button. In the JavaScript, copy the value of the text area into the new place (assign the text to innerHTML) and also call submit() on the form.

Upvotes: 0

Ahmed Khalaf
Ahmed Khalaf

Reputation: 1220

You need some server side code, asp.net or PHP

Test for Post/Get parameters Echo text in response

If you need to learn about forms and server side basics w3schools.com is the best place to start

Upvotes: 1

Related Questions