hanna975
04-24-2004, 02:00 AM
:confused:
Since there are alot of people who know their stuff here, got a javascript question.
I'm a complete newb to javascript and have an assignment for class(Intro to web design) I can't fiqure out for the life of me.
I need to create 2 text boxes and 2 buttoms that perform certain tasks in javascript.
The alert button I fiqured out(Display input from textbox1 in an alert window).
The switch button, I'm stuck on. I need to take the input from textbox1 and place in textbox2 when clicked. I declared the variable "switch" to use for that function. Here is the code I have so far. The question marks are where I'm stuck. I don't need this done for me, but help is appreciated.
Thanks in advance on this one.
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Brad Hanna's lab4/19</title>
<script type="text/javascript" language="javascript">
var switch;
switch = (stuff1);
function helloalert(input)
{
window.alert(input)
}
</script>
</head>
<body>
<h1>Lab 4/19</h1>
<p>Type anything in the first field</p>
<form>
<input name="stuff1" type="text" />
<input name="stuff2" type="text" /><br/>
<input name="alert" type="button" value="Alert"
onclick="helloalert(form.stuff1.value)" />
<input name="switch" type="button" value"Switch"
onclick=?????? />
</form>
</body>
</html>
Since there are alot of people who know their stuff here, got a javascript question.
I'm a complete newb to javascript and have an assignment for class(Intro to web design) I can't fiqure out for the life of me.
I need to create 2 text boxes and 2 buttoms that perform certain tasks in javascript.
The alert button I fiqured out(Display input from textbox1 in an alert window).
The switch button, I'm stuck on. I need to take the input from textbox1 and place in textbox2 when clicked. I declared the variable "switch" to use for that function. Here is the code I have so far. The question marks are where I'm stuck. I don't need this done for me, but help is appreciated.
Thanks in advance on this one.
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Brad Hanna's lab4/19</title>
<script type="text/javascript" language="javascript">
var switch;
switch = (stuff1);
function helloalert(input)
{
window.alert(input)
}
</script>
</head>
<body>
<h1>Lab 4/19</h1>
<p>Type anything in the first field</p>
<form>
<input name="stuff1" type="text" />
<input name="stuff2" type="text" /><br/>
<input name="alert" type="button" value="Alert"
onclick="helloalert(form.stuff1.value)" />
<input name="switch" type="button" value"Switch"
onclick=?????? />
</form>
</body>
</html>