I am new to coldfusion and i am trying out a sample cfm page. I have a dropdown where in i have 3 values say 1,2,3. Onchange of the dropdown, i need to set a hidden variable with the changed dropdown value. I am able to alert the dropdown value in javascript but not able to assign that value to the hidden variable. Please assist me.
My Sample code is as below:

<script language="javascript">
function loadHiddenvar()
alert("inside fn");
var ddVal=doent.getElementById('dd1').value;
<form name="test" id="test">
DD1: <select name="dd1" id="dd1" onchange="loadHiddenvar();">
<option value=1>first</option>
<option value=2>second</option>
<option value=3>third</option>
<option value=4>fourth</option>
<input type="hidden" name="h1" id="h1" value= "">
<cfif isdefined("form.h1")>
<cfoutput>Hidden var is #FORM.h1#</cfoutput>
Its always giving me h1 undefined in form.
What is it I am missng here?

Thanks in advance,