zippers24
07-15-2008, 09:26 AM
I currently have the following form. This is in HTML, although it has been generated dynamically:
<form name="colsizform">
<span class="ProductSize">
<select id=""sizesdrop"" name="sizesdrop" onChange="getValue()">
<option value ="M">M</option>
<option value ="L">L</option>
<\select> != </select>
<br/><br/>
Colours:
</span>
<span class="ProductColour">
<select id="coloursdrop" name="coloursdrop" onChange="getValue()">
<option value="Black with White face">Black with White face</option>
<option value="Navy with Light Blue face">Navy with Light Blue face</option>
<option value="White with Blue face">White with Blue face</option>
<option value="Classic Olive with Beige face">Classic Olive with Beige face</option>
<\select> != </select>
<br/><br/>
</span>
</form>
I also have the follwing JavaScript within the file.
<script language="javascript" type="text/javascript">
function getValue() {
var selected_value = document.colsizform.sizedrop.value;
document.getElementById("value");
value.innerHTML = currentvalue;
document.write (selected_value);
}
</script>
I want the selected_value variable to contain the currently selected size. However when I change the value in the selection box nothing happens, I know the function is being called when I change the value because it will print a variable defined within the function. Could someone please help me to solve this problem?
Any help would be appreciated.
<form name="colsizform">
<span class="ProductSize">
<select id=""sizesdrop"" name="sizesdrop" onChange="getValue()">
<option value ="M">M</option>
<option value ="L">L</option>
<\select> != </select>
<br/><br/>
Colours:
</span>
<span class="ProductColour">
<select id="coloursdrop" name="coloursdrop" onChange="getValue()">
<option value="Black with White face">Black with White face</option>
<option value="Navy with Light Blue face">Navy with Light Blue face</option>
<option value="White with Blue face">White with Blue face</option>
<option value="Classic Olive with Beige face">Classic Olive with Beige face</option>
<\select> != </select>
<br/><br/>
</span>
</form>
I also have the follwing JavaScript within the file.
<script language="javascript" type="text/javascript">
function getValue() {
var selected_value = document.colsizform.sizedrop.value;
document.getElementById("value");
value.innerHTML = currentvalue;
document.write (selected_value);
}
</script>
I want the selected_value variable to contain the currently selected size. However when I change the value in the selection box nothing happens, I know the function is being called when I change the value because it will print a variable defined within the function. Could someone please help me to solve this problem?
Any help would be appreciated.