D
David Shorthouse
Folks,
I have a drop-down select menu generated server-side. I was hoping to
pass more than a single variable from the option value to a javascript
function. Is this possible? At the moment, my option values consist of three
numbers separated by commas. I thought I could pass these three numbers as
three distinct variables to the javascript function, but it obviously
doesn't work this way.
e.g.
<select name="selectname">
<option value="1,2,3">first selection</option>
etc.
</select>
<input type=button
onclick="dothis(document.form.selectname.options[document.form.selectname.selectedIndex].value)">
can't evidently be used as
<script lang="javascript">
function dothis(a,b,c) {
etc.
}
</script>
Any suggestions?
Dave
I have a drop-down select menu generated server-side. I was hoping to
pass more than a single variable from the option value to a javascript
function. Is this possible? At the moment, my option values consist of three
numbers separated by commas. I thought I could pass these three numbers as
three distinct variables to the javascript function, but it obviously
doesn't work this way.
e.g.
<select name="selectname">
<option value="1,2,3">first selection</option>
etc.
</select>
<input type=button
onclick="dothis(document.form.selectname.options[document.form.selectname.selectedIndex].value)">
can't evidently be used as
<script lang="javascript">
function dothis(a,b,c) {
etc.
}
</script>
Any suggestions?
Dave