Jump to content

Passing data from html calendar field to php


wobuck

Recommended Posts

I have some code below but am unable to get the dates (date13 & date14) passed to a php file.

 

<HTML>

<HEAD>

<TITLE>JavaScript Toolbox - Calendar Popup To Select Date</TITLE>

<SCRIPT LANGUAGE="JavaScript" SRC="CalendarPopup.js"></SCRIPT>

<SCRIPT LANGUAGE="JavaScript" ID="js13">

var cal13 = new CalendarPopup();

</SCRIPT>

</HEAD>

<BODY>

 

<FORM NAME="example">

Start date and end date, with end date defaulting to same date as start date<BR>

Start: <INPUT TYPE="text" NAME="date13" VALUE="" SIZE=25>

<A HREF="#" onClick="cal13.select(document.forms[0].date13,'anchor13','dd/MM/yyyy'); return false;" TITLE="cal13.select(document.forms[0].date13,'anchor13','MM/dd/yyyy'); return false;" NAME="anchor13" ID="anchor13">select</A>

   

End: <INPUT TYPE="text" NAME="date14" VALUE="" SIZE=25>

<A HREF="#" onClick="cal13.select(document.forms[0].date14,'anchor14','dd/MM/yyyy',(document.forms[0].date14.value=='')?document.forms[0].date13.value:null); return false;" TITLE="cal13.select(document.forms[0].date14,'anchor14','MM/dd/yyyy',(document.forms[0].date14.value=='')?document.forms[0].date13.value:null); return false;" NAME="anchor14" ID="anchor14">select</A>

 

</FORM>

 

 

 

<form method="get" action="nextfile.php">

<input type="hidden" name="date13" size="12" value="date13"">

<input type="hidden" name="date14" size="12" value="date14">

<input name="Submit1" type="submit" value="submit"></form>

 

</BODY>

</HTML>

 

Any help appreciated

Problem Solved!

 

Here is the code that works:

 

<HTML>

<HEAD>

<TITLE>JavaScript Toolbox - Calendar Popup To Select Date</TITLE>

<SCRIPT LANGUAGE="JavaScript" SRC="CalendarPopup.js"></SCRIPT>

<SCRIPT LANGUAGE="JavaScript" ID="js13">

var cal13 = new CalendarPopup();

</SCRIPT>

</HEAD>

<BODY>

<FORM NAME="example" method="get" action="nextfile.php">

Start date and end date, with end date defaulting to same date as start date<BR>

Start: <INPUT TYPE="text" NAME="date13" VALUE="" SIZE=25>

<A HREF="#" onClick="cal13.select(document.forms[0].date13,'anchor13','dd/MM/yyyy'); return false;" TITLE="cal13.select(document.forms[0].date13,'anchor13','MM/dd/yyyy'); return false;" NAME="anchor13" ID="anchor13">select</A>

   

End: <INPUT TYPE="text" NAME="date14" VALUE="" SIZE=25>

<A HREF="#" onClick="cal13.select(document.forms[0].date14,'anchor14','dd/MM/yyyy',(document.forms[0].date14.value=='')?document.forms[0].date13.value:null); return false;" TITLE="cal13.select(document.forms[0].date14,'anchor14','MM/dd/yyyy',(document.forms[0].date14.value=='')?document.forms[0].date13.value:null); return false;" NAME="anchor14" ID="anchor14">select</A>

<input type="submit" name="submit" value="SUBMIT" class="red">  

</FORM>

</BODY>

</HTML>

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.