View Full Version : Get value from a <select>

02-19-2007, 11:16 AM
I was wondering. Is it possible to retrieve the value of a select. I have a select with all the months of the year.

<select name="selection">

When someone chooses for instance "februari" I want that value to be given to an <input type="text" name="invoer">

I tried things like

invoer.value = selection.value;

But that did not work. How do I get this value??

Thanx in advance,


02-19-2007, 01:09 PM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"


<script language="JavaScript" type="text/javascript">
var MonthAry=['januari','Februari','Maart','April','Mei','Juni','Juli','Augustus','September','Oktober','Novermber ','December'];

function Populate(frm,sel,ary){
for (var zxc0=0;zxc0<ary.length;zxc0++){
document[frm][sel].options[zxc0+1]=new Option(ary[zxc0],ary[zxc0],true,true);

function Write(sel,tb){


<body onload="Populate('MyForm','selection',MonthAry);" >

<form name="MyForm" >
<select name="selection" onchange="Write(this,'monthtxt');" >
<option value="" >Select Month</option>
<input name="monthtxt" type="text" size="10" >


EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum