By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,818 Members | 2,121 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,818 IT Pros & Developers. It's quick & easy.

Display textbox value below textbox and store previous messages

P: 3
hi all..
I m new to html....In my html page i place one multiline textbox...My query is when i enter data into textbox and click submit button..i have to display dat message in below to the textbox..and i have to display all previous msgs also...means add all values one below to do thiis by using html and javascript...and how to store previous values ..

Aug 4 '08 #1
Share this Question
Share on Google+
10 Replies

Expert Mod 15k+
P: 16,027
What have you managed so far?

If you can only use JavaScript and have no server-side language, then you can use cookies, but there's a limit to how much you can store.
Aug 4 '08 #2

P: 3
i can use java script and html also...
Aug 4 '08 #3

P: 3
Hi all,
I am using html textbox...when i click submit button i have to display that value into below the text box..How to get the text box value by using html/Javascript????
Thank You
Aug 4 '08 #4

Expert Mod 15k+
P: 16,027
I know, you said that in the original post. The question is can you use a server-side language, e.g. ASP, PHP, JSP, Perl, Coldfusion?
Aug 4 '08 #5

Expert 100+
P: 1,654
Make a div below the textarea, and add the code to the onclick event of required button/link.
Expand|Select|Wrap|Line Numbers
  1. document.getElementById('divID').innerHTML = document.forms['formName'].textareaName.value;
  2. //where
  3. //divId = id of the div
  4. //formName = name of the form
  5. //textareaName = name of the textarea
Aug 4 '08 #6

P: 6

You can use the id attribute of HTML textboxes to access them in javascript.

<input type="text" id="txt1" />
<input type="text" id="txt2" />

To set the value of txt2 textbox you can use simple HTML button.

<input type="button" id="btn" value="Click">

Use the following javascript code to get and set the values of textboxes:

document.getElementById('txt2').value = document.getElementById('txt1').value;

Apply the above javascript code onclick event of button.

I hope this will do...
Aug 6 '08 #7

Expert Mod 15k+
P: 16,027
Moved to JavaScript and merged threads.

Aug 6 '08 #8

P: 607
Hi Lakkhi, I am not getting you rrequirement. You are using one HTMl text Box in a page and you are entering some values in that text box after you submit it must move to the next HTML page were you have to display the entered message in a text box in the new page. Or you are having two text boxes in a same page when u click a button content of the first text box should be concatenated with the content of the second text box. please mention ur requirement clearly. I will try to help u out.

Ramanan Kalirajan
Aug 7 '08 #9

P: 6
Hi lakki

I think you are trying to concatenate the old and new messages in the second textbox one below another. Then, you have to use HTML textarea control to display each message retrieved from first textbox in new line.

Consider my previous code:

Use += instead of only = sign in javascript code. And concatenate + "\n" at the end of assigned value to textarea.

Try this. Otherwise send more information about your problem.
Aug 7 '08 #10

P: 1
can you help me please, im trying to develop a website, can you show me how to create to text box and a command button so that when the user enters data in the tex box, i want the button to be able to save the data to a text file. thank you
Aug 21 '10 #11

Post your reply

Sign in to post your reply or Sign up for a free account.