This is the message I get within the document.write output ("document.write(bodytype);")

[objectHTMLSelectElement]

This is my attempt to get a value from the dropdownbox;

var bodytype=document.getElementById("bodytype");
document.getElementById("bodytype").value=bodytype.options[bodytype.selectedIndex].text;

This is the dropdown box code that it's meant to come from;

<select id="bodytype" name="bodytype">
<option>fat</option>
<option>lean</option>
<option>slender</option>
<option>short</option>
<option>tall</option>
</select>

It's printing what it is to the screen rather than the text... am I just missing "" somewhere?

Are you saying you want to send some other value on select of drop down.Instead of text use value.

var bodytype=document.getElementById("bodytype");
alert(bodytype.options[bodytype.selectedIndex].text);
alert(bodytype.options[bodytype.selectedIndex].value);
document.getElementById("bodytype").value=bodytype.options[bodytype.selectedIndex].text;

Your html

<select id="bodytype" name="bodytype">
<option value="F">fat</option>
<option value="L">lean</option>
<option value="SL">slender</option>
<option value="S">short</option>
<option value="T">tall</option>
</select>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.