dropdown menu

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
carbine
Forum Newbie
Posts: 6
Joined: Mon Mar 14, 2005 6:37 am

dropdown menu

Post by carbine »

When i select a value from a dropdown menu I want the following text area in a form to contain a piece of text according to the value selected.

I've tried the onchange attribute for select, but I don't want to change the page-I just want to influence the text displayed in an input area of the form while staying on the same page.

Any suggestions would be greatly appreciated!
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Post by pickle »

You could do something like this:

Code: Select all

onChange = &quote;document.customDiv.innerHTML = 'Updated info';&quote;
-- OR --

Code: Select all

onChange = &quote;document.customForm.customElement.value = 'Updated info';&quote;
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply