I know that this might be very simple question and I tried to find solutions in the web but I can't figure it... I have the following C# / ASPX code:
SelectArea += "<select name=\"Area\" id=\"area\">" + "<option value=\"Default\" style=\"display:none;\">SELECT AREA</option>";
for (i = 0; i < ds.Tables[0].Rows.Count; i++)
{
AreaName = ds.Tables[0].Rows[i]["AreaName"].ToString();
SelectArea += string.Format("<option value=\"{0}\"/>{0}</option>", AreaName);
}
SelectArea += "</select>";
And this javascript function that happeen after submit
function validateProfile() {
var el = document.getElementById("area").value;
alert(el);
}
I want some how to get the number of the selected value in the list. I tried with the code above but it doesn't work.
wish for help, thanks!