473,406 Members | 2,345 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Display Text on same page

This is the html pgm I am using:
Expand|Select|Wrap|Line Numbers
  1. ------
  2. <html>
  3. <head>
  4. <title>Form Example</title>
  5. <script LANGUAGE="JavaScript">
  6. function display() {
  7. //DispWin = window.open('','NewWin', 'toolbar=no,status=no,width=300,height=200')
  8. message = "<ULul><LIli><b>NAME: </b>" + document.form1.yourname.value;
  9. message += "<LIli><b>ADDRESS: </b>" + document.form1.address.value;
  10. message += "<LIli><b>PHONE: </b>" + document.form1.phone.value + "</ULul>";
  11. document.write(message);
  12. }
  13. </script>
  14. </head>
  15. <body>
  16. <h1>Form Example</h1>
  17. Enter the following information.
  18. <form name="form1">
  19. <p><b>Name:</b> <input TYPE="TEXT" LENGTH="20" NAME="yourname">
  20. <P/p>
  21. <p><b>Address:</b> <input TYPE="TEXT" LENGTH="30" NAME="address">
  22.  
  23. </pP>
  24. <p><b>Phone: </b> <input TYPE="TEXT" LENGTH="15" NAME="phone">
  25. </pP>
  26. <p><input TYPE="BUTTON" VALUE="Display" onClick="display();"></p>
  27. </form>
  28. </body>
  29. </html>
  30. ----------
When I am pressing display button the values are displayed in another screen....instead I wnat the values to be displayed in the form itself(below the boxes).....
Aug 25 '11 #1
3 3664
Rabbit
12,516 Expert Mod 8TB
That's because you're using document.write. Instead, use the innerHTML attribute of an element with an id.

On a side note, I don't know what </pP> and <P/p> are, they're not syntactically correct.
Aug 25 '11 #2
Thnx a lot...can you tell me how the coding should be then?
Aug 26 '11 #3
Rabbit
12,516 Expert Mod 8TB
I don't normally give out code. Give my suggestion a shot and post back with the code you tried if you run into trouble implementing it.
Aug 26 '11 #4

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

Similar topics

7
by: yawnmoth | last post by:
i'm trying to display text while a page is loading using a method similar to the following: <? ob_end_flush(); echo 'AAA<br>'; flush(); sleep(10); echo 'BBB'; ?>
0
by: Mahita | last post by:
Hi All, My requirement is that I need to display in the same page/document some text in English and some other text in localized language (French, german etc). Can you please let me know whether...
0
by: Mahita | last post by:
Hi, I have the following requirement in my project. I need to display some text in English and other text in localized language (French, german etc) in the same page/document. Can you please let...
1
by: cc0274754 | last post by:
I currently use a switch case structure to display text so different stuff appears each day of the week. It is a pain in the butt to put the text in "document.write" statements. Is there any way...
1
by: mela | last post by:
it seems quite stupid but i am building up my web site and i am stocked with this problem: i download this photoslider script and wanted to have two on the same page but they are interfering one each...
2
by: mukeshrasm | last post by:
hello i want to display the subjects on the same page based on class selected by user. i am using dropdown for classes. so when user will select a particular class then it will display subjects in...
4
by: giandeo | last post by:
Hello experts. I wish to post a string and display the output in the same page. The Scenario: Table name: importer Field name: imp_code, imp_sname, imp_address, imp_tel I have a page...
11
by: mrking | last post by:
Hi, First time in the Java section here. I have an HTML form and a PHP script to do a simple calculation but it has to take me to a different page for the results. The calculator is really...
14
by: kip1790 | last post by:
See example here Ultimately I want the image created to display next to the update button in the same browser window instead of loading into a new window. Then every time I input text and click...
4
by: FritzGamaliel | last post by:
I have searched in google about my problem. But I don't get the best solution for my need. My Problem is: I create a form with TextBox Name, TextBox Message, Submit button, and it use POST...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.