Of course it doesn't work. I gave you an example of exactly what you asked
for: how to make a form field the same value as another form field. The
example was a single line of JavaScript. You copied my entire message
(including the word "JavaScript:", but minus my signature) and inserted it
into an HTML document, changing only the form field names.
I don't spoon-feed people who ask questions. My philosophy is "teach a man
to fish." I gave you an example line of code. Your job was to take the
example, study it, and implement your own solution. If you didn't understand
it, you should have asked for clarification.
There are rules for JavaScript in an HTML document, just as there are rules
for everything else. You have to put the JavaScript into a script block,
first. EXAMPLE:
<script type="text/javascript"><!--
// Script here
// --></script>
Second, all you asked was how to put a value from one form field into
another. What's missing is the WHEN, and WHY to do so. You would need to
determine a business rule that defines when the text field should be
assigned the value from the <select> object, such as, for example, when the
selection changes. I don't know the answer to that one; only you can decide
what your business rules are. If you can tell us that, I can give you more
information about how to accomplish it.
Third, I noticed that the </body> tag appears BEFORE a whole bunch of HTML
in your document. The </body> tag should be the last thing in the page
before the </html> tag.
--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
SteveL said:
Kevin,
I must be doing something wrong: Doesn't work for me.
Here's my sample code: (Help!)
<html>
<head>
<title>Sample Form</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1"></head><BODY bgcolor="#FFCC00"
text="#000000" onLoad="window.resizeTo(800,900);">
<body>
</body>
<p><font face="Verdana" size="2">Drop-Down Choice:
</font>
<select size="1" name="price" style="font-
family: Verdana; font-size: 10pt">
<option value="25.00">25.00</option>
<option value="50.00">50.00</option>
<option value="75.00">75.00</option>
</select></p>
JavaScript:
document.forms[0].order_price.value =
document.forms[0].price.value;
<p><font face="Verdana"><font size="2">Choice value to
display here: </font><input type="text"
name="order_price" size="20"></font></p></BODY>
</html>
-----Original Message-----
JavaScript:
document.forms[0].FormFieldName.value =
document.forms[0].OtherFormFieldName.value;
--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
I have a simple htm page with a drop down field.
Depending on the user's choice, the value of this drop-
down field will either be $25.00, $50.00 or $75.00.
So then I need to display the value of the first field in
another field further down on the page.
How do I do this?
--Steve
.