473,327 Members | 1,920 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,327 software developers and data experts.

How to create a textbox button that will repeat contents of textbox?

I need to write an HTML page that uses an input text box to ask the viewer for a phrase. The page should also contain a button. When the button is pressed, the page should display the input phrase 10 times. The HTML page should use a JavaScript function to write out the phrase. (So if the user enters "Hello World", the page should display "Hello World" 10 times.)
Jan 23 '11 #1
5 2493
Rabbit
12,516 Expert Mod 8TB
What have you tried so far?
Jan 23 '11 #2
Employing various forms of while loops but with little success. Its an assignment for a computer class I have to take in college and I basically havent grasped anything in the course so far
Jan 23 '11 #3
Rabbit
12,516 Expert Mod 8TB
Post your latest code
Jan 23 '11 #4
<html>
<head><h1>HW 11 part 2</h1></head>
<body>
<h2>Write Phrase Here:</h2><br>

<script language="Javascript">
loop = <input type='text' id='text1' value=''>;

while (repcount = 10);
{
document.write("text1”);
}

<script language="Javascript">

<input type="button" value="click here"
onClick="text1 = document.getElementById('text1').value;

</body>
</script>
</body>
</html>
Jan 23 '11 #5
Rabbit
12,516 Expert Mod 8TB
The code is a mess. Here's a link to a tutorial that will give you the basics of javascript. http://www.w3schools.com/js/js_intro.asp
Jan 24 '11 #6

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

Similar topics

5
by: dave | last post by:
Hello, I've got a page, actually a friend does, that he'd like to update with his schedule for the week. THis is a simple html page, and he'd like to do this via a php script. Ideally one would...
3
by: vishal | last post by:
i am creating a news site. i am adding new news in database and it must be visible to user at top. and then second latest news and so on. i am displaying 15 news on each page and then put a link...
13
by: gsb | last post by:
Object tag to write HTML page to via JavaScript? I've used iFrames and Objects to load web pages into another page. I want to do similar but not load a uri, rather write the page, <HTML>...
1
by: Andrew | last post by:
Hi, I've tried creating a very basic class library. It has one object and one property. The property returns always the same string value. I then use the <OBJECT> tag to embed the dll in my...
5
by: AFN | last post by:
I'm trying to set a submit button to change text and color when clicked. Like saying "please wait" instead of "submit" and then changing the background color and text color. All works, except for...
3
by: mukeshgupta.WD | last post by:
i am developing a website in which i want to call a html page load into a div tag dynamically followed by link. i want to change the html page every time when a link is clicked. can any body have...
8
by: rn5a | last post by:
I have a HTML page named Index.html which is divided into 3 frames. The URL of 2 of the frames are HTML pages but the 3rd frame houses a ASP page. Now when I go to Windows Explorer, navigate to...
10
by: paulie | last post by:
Hi, I have been experiencing an issue when trying to use AJAX to reload a DIV area using a timer of 2000ms, which contains a html page with another DIV and javascript. Scenario -------------...
2
by: =?Utf-8?B?Q2hhcnRz?= | last post by:
I have been writing C# programs to spider yellow page to get list of restaurant name, address to the database. When I encounter button or hyperlink, I don’t know how to use the program to click...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.