Changes

Add Options to a Combo Box Using JavaScript

87 bytes removed, 15:54, 4 August 2009
no edit summary
function clearTimes()
{
if (var frm = document.forms[0];// at Level 1 use document.form1 instead of document.forms[0] if (frm.startdate.value=="")
{
try
{
document.forms[0]frm.starthour.add(new Option("", "", true, true), document.forms[0]frm.starthour.options[0]) //add blank option to beginning of starthour document.forms[0]frm.startminute.add(new Option("", "", true, true), document.forms[0]frm.startminute.options[0]) document.forms[0]frm.endhour.add(new Option("", "", true, true), document.forms[0]frm.endhour.options[0]) document.forms[0]frm.endminute.add(new Option("", "", true, true), document.forms[0]frm.endminute.options[0])
}
catch(e)
{ //in IE, try the below version instead of add()
document.forms[0]frm.starthour.add(new Option("", "", true, true), 0) //add blank option to beginning of starthour document.forms[0]frm.startminute.add(new Option("", "", true, true), 0) document.forms[0]frm.endhour.add(new Option("", "", true, true), 0) document.forms[0]frm.endminute.add(new Option("", "", true, true), 0)
}
}
}
clearTimes();
 
</pre>
0
edits