sorry about the OT post..I need help with a select box.  I am making 2 select
boxes (Month and Day).  when the user changes the month, I want the javascript
to delete what is in the day select box and fill it with the number of days in
that month.  I have the deleting part working.  It just won't add.  I'm not sure
what I need to do.  Here is my code(Please ignore that I HAVE to use ASP for
this)..


<select name="month" size="1"
onChange="changeMonth(this.form,this.form.day,this.form.month.options[this.form.
month.selectedIndex].value);">
        <option value="1" SELECTED>January</option>
        <option value="2">February</option>
        <option value="3">March</option>
        <option value="4">April</option>
        <option value="5">May</option>
        <option value="6">June</option>
        <option value="7">July</option>
        <option value="8">August</option>
        <option value="9">September</option>
        <option value="10">October</option>
        <option value="11">November</option>
        <option value="12">December</option>
        </select></td>
        <td>Day:</td><td><select name="day" size="1">
        <%for i = 1 to 31%>
        <option value="<%=i%>"><%=i%></option>
        <%next%></select></td>



<script language="JavaScript1.2">

   
function changeMonth(theform,selectCtrl,iValue) {
var oNewOption;
iSelection = iValue;

iOptLen=selectCtrl.length + 1;

for (i=0;i<=iOptLen;i=i+1) {
 
  selectCtrl.options[0] = null;
  
  
  }

if (iSelection == "1" || iSelection == "3" || iSelection == "5" || iSelection ==
"7" || iSelection == "8" || iSelection == "10" || iSelection == "12") {
  for (i=0;i<=30;i=i+1) {
    selectCtrl.options[i] = i+1;
        }

}
if (iSelection == "2") {
  for (i=0;i<=27;i=i+1) {
    selectCtrl.options[i] = i+1;
        }
}
if (iSelection == "4" || iSelection == "6" || iSelection == "9" || iSelection ==
"11") {
  for (i=0;i<=29;i=i+1) {
    selectCtrl.options[i] = i+1;
        }

}



}



</script>



 Someone please drop me a line and tell me what I am doing wrong.  I am
absolutely clueless....



Thanks,


Brian Yager
President - North AL Cold Fusion Users Group
Sr. Systems Analyst
NCCIM/CIC
[EMAIL PROTECTED]
(256) 842-8342
______________________________________________________________________
Get Your Own Dedicated Windows 2000 Server
  PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation · $99/Month · Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusionb
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to