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

Link to comment
Share on other sites

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>

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.