Changes

Add Options to a Combo Box Using JavaScript

638 bytes added, 20:37, 31 July 2009
no edit summary
<pre>
function changeStartHourclearTimes()
{
if (document.forms[0].eventidstartdate.value==0""){
try
{
document.forms[0].starthour.add(new Option("", "", true, true), document.forms[0].starthour.options[0]) //add blank option to beginning of starthour document.forms[0].startminute.add(new Option("", "", true, true), document.forms[0].startminute.options[0]) document.forms[0].endhour.add(new Option("", "", true, true), document.forms[0].endhour.options[0]) document.forms[0].endminute.add(new Option("", "", true, true), document.forms[0].endminute.options[0])
}
catch(e)
{ //in IE, try the below version instead of add()
document.forms[0].starthour.add(new Option("", "", true, true), 0) //add blank option to beginning of starthour document.forms[0].startminute.add(new Option("", "", true, true), 0) document.forms[0].endhour.add(new Option("", "", true, true), 0) document.forms[0].endminute.add(new Option("", "", true, true), 0)
}
}
}
changeStartHourclearTimes();
</pre>
0
edits