can i use id on html:select syntax...
843723Jun 15 2011 — edited Jul 5 2011Hi,
i am using the following code to take data from the database directly to a dropdown box.
<html:select property="lddate" style = "width:160">
<html:option value="--SELECT--">SELECT</html:option>
<html:options collection="loadDateList" name="almRecordsNotProcessedBO" property="lddate"
labelProperty="lddate"/>
</html:select>
then after selecting the load-date from the drop-down box & clkng on submit button page is wrkng fine but in the dropdown it not showing the selected date.it is showing the default 1st entry in the drop-down box.
Now i using a javascript for showing the selected date::::
<script type="text/javascript">
function getText(){
var x=document.getElementById("aSelectControl")
alert(x.options[x.selectedIndex].text)
}
</script>
But here i needed an id . In my Drop-down select code where i shuld use this id..i dont understand..i have checked for syntax of html:select but there is no id tag attribute of html:select.can anyone suggest me any other idea how to show that.
can any one help me ..its very very urngent. i got stuck..plzzzz
I have checked in the internet there is a select syntax where i can make use that id..
Select the load date:
<select id="aSelectControl">
<option>25-12-2011</option>
<option>26-11-2011</option>
<option>27-11-2011</option>
</select>
But here the problem is i have to write the dates in a jsp page..but its not poss for my case...i have to take the date from databse. can any one tell me if i using the above query how to take data from the database.
plzzzz help me..