Welcome to the Cumulus Support forum.

Latest Cumulus MX V4 release 4.4.2 (build 4085) - 12 March 2025

Latest Cumulus MX V3 release 3.28.6 (build 3283) - 21 March 2024

Legacy Cumulus 1 release 1.9.4 (build 1099) - 28 November 2014
(a patch is available for 1.9.4 build 1099 that extends the date range of drop-down menus to 2030)

Download the Software (Cumulus MX / Cumulus 1 and other related items) from the Wiki

If you are posting a new Topic about an error or if you need help PLEASE read this first viewtopic.php?p=164080#p164080

Datepicker

Other discussion about creating web sites for Cumulus that doesn't have a specific subforum

Moderator: daj

Post Reply
ant30
Posts: 18
Joined: Thu 16 Apr 2015 4:19 pm
Weather Station: WS2307
Operating System: Win7 32bit
Location: Slovenia
Contact:

Datepicker

Post by ant30 »

Hey,
Im trying to use jquery datepicker to query my data im database and show on webpage.
Here is my code. I dont know what is wrong. Im stuck on this point for days.

Code: Select all

</head>
<body>
    <script type="text/javascript" language="javascript">
            jQuery(function() {
                jQuery( "#from" ).datepicker({
                  defaultDate: "+0w",
                  changeMonth: true,
                  numberOfMonths: 1,
                  onClose: function( selectedDate ) {
                    $( "#to" ).datepicker( "option", "minDate", selectedDate );
                  }
                });
                jQuery( "#to" ).datepicker({
                  defaultDate: "+0w",
                  changeMonth: true,
                  numberOfMonths: 1,
                  onClose: function( selectedDate ) {
                    jQuery( "#from" ).datepicker( "option", "maxDate", selectedDate );
                  }
                });
            });
</script>
    <form action="" method="post">
    <label style="margin: 0 10px 0 20px;" for="from">From</label>
    <input style="padding: 3px; border-radius: 4px; opacity: none; background: #EEEEEE;" type="text" id="from" name="from" />
    <label style="margin-left: 10px;" for="to">To</label>
    <input style="padding: 3px; border-radius: 4px; background: #EEEEEE;" type="text" id="to" name="to" />
	<input type="submit" name="filterDate" value="Submit" />
    </form>

 <?php
include 'dbconfig.php';

extract($_POST);
$sql1=mysql_query("Select Relhum from realtime where date between '".$from_date." and '".$to_date."'");


echo "<table border='1'>
	  <tr>
		<th>Relhum</th>

	 </tr>";
		while($row = mysql_fetch_array($sql1))
		{
		  echo "<tr>";
			  echo "<td>" . $row['Relhum'] . "</td>";

		  echo "</tr>";
		}
echo "</table>";
?>
 
 

</body>
Thanks for help
Image
User avatar
mcrossley
Posts: 14384
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Datepicker

Post by mcrossley »

It is much easier to help if you also post a link to test page that we can look at.
ant30
Posts: 18
Joined: Thu 16 Apr 2015 4:19 pm
Weather Station: WS2307
Operating System: Win7 32bit
Location: Slovenia
Contact:

Re: Datepicker

Post by ant30 »

Image
User avatar
mcrossley
Posts: 14384
Joined: Thu 07 Jan 2010 9:44 pm
Weather Station: Davis VP2/WLL
Operating System: Bullseye Lite rPi
Location: Wilmslow, Cheshire, UK
Contact:

Re: Datepicker

Post by mcrossley »

I guess you fixed it? It seems to be working fine now.
ant30
Posts: 18
Joined: Thu 16 Apr 2015 4:19 pm
Weather Station: WS2307
Operating System: Win7 32bit
Location: Slovenia
Contact:

Re: Datepicker

Post by ant30 »

Hey,
Yes my Datepicker work now but i still have problem :bash: with getting data from database.
When I click "submit" button nothing is happen :groan:
Image
Post Reply