Theiling Online    Sitemap    Conlang Mailing List HQ    Attic   

Re: OT: TECH: JavaScript help

From:Gary Shannon <fiziwig@...>
Date:Monday, December 22, 2008, 22:40
--- On Mon, 12/22/08, Mark J. Reed <markjreed@...> wrote:

> From: Mark J. Reed <markjreed@...>
> I'm still not clear on the purpose here. That will > display the > "value" of the option inside the text input, > sure. Is that what Benct > was asking for?
My bad. Here's what I think he's after: This puts the long text values into the input box based on the selected option. And yes, "onclick" was the wrong one to use. Corrected here: <head> <title>test</title> <script language="javascript"> var text_values = new Array(); text_values[0] = "long text for tee"; text_values[1] = "longer text for tie"; text_values[2] = "even longer text text for toe"; function update(index) { document.my_form.foo.value=text_values[index]; } </script> </head> <body> <form name="my_form" action="test.html"> <input type="text" name="foo" value="text for one"> <select name="bar" onchange="update(document.my_form.bar.selectedIndex)"> <option value="tee" selected="selected">tee</option> <option value="tie">tie</option> <option value="toe">toe</option> </select> </form> </body>

Reply

Mark J. Reed <markjreed@...>