Jump to content

randunn

Members
  • Posts

    1
  • Joined

  • Last visited

Everything posted by randunn

  1. So I've gotten my code to display the correct current date in the 1st text box, but then when I choose one of the radio buttons to choose my "Pick-Up" date, the 2nd text box does not display the date. Basically, 1st box should show current date, 2nd box should show the date chosen from the radio buttons (imagine dropping off film that needs developed and you are choosing whether you want it 1 day, 2 days, or 3 days processing). I am including my full code so you can see what I'm doing. Can someone please show me what I'm doing wrong... ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- <script type="text/javascript"> /*<![CDATA[*/ function my_curr_date() { var currentDate = new Date() var day = currentDate.getDate(); var month = currentDate.getMonth() + 1; var year = currentDate.getFullYear(); var my_date = month+"-"+day+"-"+year; document.getElementById("dateField").value=my_date; } function orderReady(orderTime){ dateToday.setDate(dateToday.getDate()+orderTime); var ready=dateToday.getMonth()+"/" +dateToday.getDate()+"/"+dateToday.getFullYear(); document.getElementById("duedateField").value=due_date; } /*]]>*/ </script> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- <body onload='return my_curr_date();'> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- <p>Item<br /> <input type="radio" name="item" value="print_5x7" onclick="orderReady(1)" />5x7 Prints(1 day) <input type="radio" name="item" value="poster" onclick="orderReady(1)" />Poster (1 day) <input type="radio" name="item" value="mug" onclick="orderReady(2)" />Coffee Mug (2 days) <input type="radio" name="item" value="shirt" onclick="orderReady(3)" />T-shirt (3 days)</p> <p>Today's Date<br /> <input type='text' name='dateField' id='dateField' value='' /><br /> Pick-up Date<br /> <input type='text' name='duedateField' id='duedateField' value='' /></p>
×
×
  • Create New...