Jump to content

forms php


tom7890

Recommended Posts

If it has to happen without refreshing the screen you probably are talking about using a js function to capture the value and then make an ajax call that passes the value to a php script that will generate your html and then paste it into your hidden div and then make the div visible.

Link to comment
https://forums.phpfreaks.com/topic/294074-forms-php/#findComment-1503458
Share on other sites

Replacing the current <script> with this in the code I posted in your other thread will do it

<script type="text/javascript">
    //********************************************
    // Create the on-click function for each
    // clickable cell (class = day)
    // to resubmit the page with clicked date
    //********************************************
    <?php
        if (isset($_GET['date'])) {
            echo "var formvis = \"visible\";" ;
        }
        else {
            echo "var formvis = \"hidden\";" ;
        }
    ?>
    $().ready(function(){
        $(".form").css("visibility",formvis);

        $(".day").click(function(){
            location.href="?date="+$(this).attr("id");
            
        })
    })
</script>
Link to comment
https://forums.phpfreaks.com/topic/294074-forms-php/#findComment-1503473
Share on other sites

<?php

$timestamp = mktime(0,0,0,$cMonth,1,$cYear);
$maxday = date("t",$timestamp);
$thismonth = getdate ($timestamp);
$startday = $thismonth['wday'];

for ($i=0; $i<($maxday+$startday); $i++) {
    if(($i % 7) == 0 ) echo "<tr> ";

    if($i < $startday) echo "<td></td> ";

   else echo "<td align='center' valign='middle' height='20px'><a href='timeslots.html'>". ($i - $startday + 1) . "</a></td> ";
	

	
    if(($i % 7) == 6 ) echo "</tr> ";

}
?>


how do i change this???

Link to comment
https://forums.phpfreaks.com/topic/294074-forms-php/#findComment-1503474
Share on other sites

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.