Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pop up calendar

Status
Not open for further replies.

999000333

Programmer
Nov 20, 2006
39
Hello
I wrote a form in html/php where I ask the user to enter the Document Date and a start date, to do so I used a pop up calendar written in javascript here is the code:

<script language="JavaScript" type="text/javascript">
<!--
function calendarDocDateCallback(date, month, year)
{
if(date<10) { date = '0' + date; }
if(month<10) { month = '0' + month; }
document.forms[0].DocDate.value = year + '-' + month + '-' + date;
}
calendarDocDate = new dynCalendar('calendarDocDate', 'calendarDocDateCallback', '../js/dynCalendar/images/');
calendarDocDate.setMonthCombo(false);
calendarDocDate.setYearCombo(false);
calendarDocDate.setOffset(40, -40)
//-->
</script>

Now everything works fine if I put this code on ONE input text only when I put the code for the other input text nothing appears.
Can anyone give me some suggestion on how to fix this conflict problem?

Thanks.
Paola
 
You have to know which field to populate the date back into from your popup calendar so you should pass the ID of the field in your call to the popup function, pass that value along in the URL of the popup call and from the popup calendar read and use that value to determine where to write the selected value back to.
Alternatively you can save the ID as a global value, read that value from the popup window and use it to know where to write back to on the main page. The only real difference is that you do not have to pass the value on the URL and read it from there.


At my age I still learn something new every day, but I forget two others.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top