im looking to change a text box i have (which contains "male" or "female"
into a drop down list (containing both "male" and "female"
on click. here is what i have so far ....
Code:
Javascript ******
var dropDownObject = [ { text: "Male",
value: "Male" },
{ text: "Female",
value: "Female" },
];
function fillSelect() {
var select = document.getElementById( 'gender' );
var options = select.options;
options.length = 0;
for( var i = 0; i < dropDownObject.length; i++ ) {
options[ options.length ] = new Option( dropDownObject[i].text, dropDownObject[i].value);
}
}
html/xsl **********
<input type="text" name="gender" id = "gender" datasrc= "#xmlData" datafld="gender">
<xsl:attribute name="value"><xsl:value-of select="Title"/></xsl:attribute>
<xsl:attribute name="onclick"> fillSelect() </xsl:attribute>
</input>
Kenneth Birney
User Interface Programmer
Scottish Police