Probably a stupid HTML question

PAz

PAz

Soldato
Joined
18 Oct 2002
Posts
6,564
Location
Bucks
I'm sure I've done this before using either HTML or Javascript...

What I need to do is click a button, and then the action puts some text into a textbox.

Any helpers? I know I'll kick myself when I see the solution!

Thanks
 
Trigger said:
Code:
<html>

<head>

<title>JavaScript Alerts!</title>

</head>

<body>

<script language="javaScript" type="text/javascript">

</script>

<div align="center">

<form acriotn="" method="POST">

<input type="button" name="alertbutton" value="Click Me!" onClick="alert('Change this text whilst preserving the quotation marks to what you wish to appear in the messagebox...')"></input>

</form>

</div>

</body>

</html>

:)

Thanks, thats kind of it. Need it to appear in an actual HTML textbox/field though as opposed to a window prompt.

I tried changing the alert to the textbox name but that didn't work!
 
Triad2000 said:
"I'm sure I've done this before using either HTML or Javascript..." or have I had too many beers?


hahaha, I'm off the drink at the moment so I cant even use that excuse :o

ta again for all the help
 
jonnyg said:
Dude, i asked practically the same question and no-one answered me, so ill tag on your thread - can you use a drop down box to select an <option> which then affects what appears in the said text box...?

Here you go:

Code:
<form name="form1">

<select name="Colour">
  <option selected>--Select Colour</option>
  <option value="Red" onClick="document.form1.output.value='Red'">Red</option>
  <option value="Green" onClick="document.form1.output.value='Green'">Green</option>
  <option value="Blue" onClick="document.form1.output.value='Blue'">Blue</option>
</select>
<br>
<textarea name="output">

</textarea>

</form>
 
Back
Top Bottom