Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

HTML Help

Posted on 2003-03-10
7
Medium Priority
?
140 Views
Last Modified: 2010-04-09

 i have a Text box and a button on the page. Every time the user clicks the button after entering the data into the text box the data  should apper on the same page.

      Textbox

      Button ----> On Click the Data should Apper here       *****

 Also when the User writes again into the textbox and clicks the button the previous iteration data and the current data should appear.
 This should happen for 15 iterations.
 
 Kindly let me know the code about this
0
Comment
Question by:manishmarathe
  • 3
  • 2
  • 2
7 Comments
 

Author Comment

by:manishmarathe
ID: 8107317
Thanx
0
 
LVL 5

Expert Comment

by:gator4life
ID: 8107807
Here ya go:

<html>

<head>
     <script type="text/javascript">
     <!--
          function WriteText(oForm) {

               oTextbox = oForm.myTextbox;
               sText = oTextbox.value;
               document.getElementById('myDiv').innerHTML += sText + '<br>';
               oTextbox.value = '';
               oTextbox.focus();
          }
     //-->
     </script>
</head>

<body>
     <form name="myForm">
          <input type="text" name="myTextbox">
          <input type="button" name="myButton" value="Write Text" onclick="WriteText(this.form)">
     </form>
     <div id="myDiv"></div>
</body>

</html>

gator4life
(chomp, chomp)
0
 

Author Comment

by:manishmarathe
ID: 8108172
Thanx gator4life,

          I am sorry i wanted a bit different .I will edit the question.

          But thanx a lot.

          Text Box

          Button1     Button2
   
           On clicking on Button1 the data goes on adding into the array without being displayed and when we click on button2 the data of all the 15 iterations get displayed
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 5

Accepted Solution

by:
gator4life earned 200 total points
ID: 8108339
Try this:

<html>

<head>
     <script type="text/javascript">
     <!--
          var aText = new Array();
          var i = 0;

          function AddToArray(oForm) {

               with (oForm.myTextbox) {

                    aText[i] = value;
                    value = '';
                    focus();
               }

               i++;

               if (i == 15) {

                    oForm.myButton1.disabled = true;
                    oForm.myTextbox.disabled = true;
               }
          }

          function DisplayArray(oForm) {

               var sText = '';

               for (var j = 0; j < aText.length; j++)
                    sText += aText[j] + '<br>';

               document.getElementById('myDiv').innerHTML = sText;
          }
     //-->
     </script>
</head>

<body onload="document.myForm.myTextbox.focus()">
     <form name="myForm">
          <input type="text" name="myTextbox">
          <input type="button" name="myButton1" value="Add to Array" onclick="AddToArray(this.form)">
          <input type="button" name="myButton2" value="Display Array" onclick="DisplayArray(this.form)">
     </form>
     <div id="myDiv"></div>
</body>

</html>

gator4life
(chomp, chomp)
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 8820521
This question has been classified abandoned. I will make a recommendation to the
moderators on its resolution in a week or two. I appreciate any comments
that would help me to make a recommendation.

<note>
Unless it is clear to me that the question has been answered I will recommend delete.  It is possible that a Grade less than A will be given if no expert makes a case for an A grade. It is assumed that any participant not responding to this request is no longer interested in its final disposition.
</note>

If the user does not know how to close the question, the options are here:
http://www.experts-exchange.com/help/closing.jsp


Cd&

0
 
LVL 5

Expert Comment

by:gator4life
ID: 8821013
Hey COBOL, I think I deserve the points.  I am pretty sure that I answered this question with a more than thorough solution.

gator4life
(chomp, chomp)
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 9012652
It is time to clean this abandoned question up.

I am putting it on a clean up list for CS.

<recommendation>
points to gator4life -- Grade A

</recommendation>

If anyone participating in the Q disagrees with the recommendation,
please leave a comment for the mods.

Cd&

0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
This article discusses how to create an extensible mechanism for linked drop downs.
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …

569 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question