hii....
this is my first thread..hope i return satisfied..
i am a newbie in asp ,net...i want urgent help...
the following snippet i am going to present was copied from some where though it works perfectly fine...i jst want to change its functionality a bit..............its basically a drop down box...i want that whatever number i choose ie 1 2 3 ...i get 100,200,300 resp in my label11.text...the code i got uses return alert ...instead of return alert i want the value to be displayed in drop down box....the foll code is
<select id="dropdown" onchange="storeVal(this,'hiddenVal');">
<option value="default">--Select no. of seats--</option>
<option value="A">1</option>
<option value="B">2</option>
<option value="C">3</option>
<option value="D">4</option>
</select>
<input type="hidden" id="hiddenVal" />
<script type="text/javascript">
function storeVal(selectObj,id)
{
var hiddenObj = document.getElementById(id);
var optionArr = selectObj.getElementsByTagName("option");
if (selectObj.value == "default") return false;
for (i=1; i<=optionArr.length; i++)
{
if (selectObj.value == optionArr[i].value)
{
hiddenObj.value = i;
return alert('Your total cost is Rs.' +100* i + '');
}
}
}
</script>
hope to get early answers...