Jump to content

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>
Edited by Barand
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

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.