Jump to content

Tim32

Members
  • Content Count

    11
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Tim32

  • Rank
    Member
  1. Tim32

    pass parameter to activate onclick

    Thank you very much for your help. It works perfectly now.
  2. Tim32

    pass parameter to activate onclick

    It only works without the w3.css. With the w3.css nothing happens, or maybe something is happening but it is covered up? I even switched to using <link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css" type="text/css" media="screen"> in case my copy of w3.css was bad.
  3. Tim32

    pass parameter to activate onclick

    I am sorry I didn't get back sooner but I had a different project I had to get today. The div.w3-modal doesn't work either. Nothing happens when I click Event1.
  4. Tim32

    pass parameter to activate onclick

    Yes they are separate files. Now Clicking on Event1 in Events.php does nothing. Clicking on Event1 in index.php opens Events.php but does nothing. <!DOCTYPE html> <html lang="en"> <title>Special Events</title> <head> <link rel="stylesheet" href="/css/w3.css"> <style> a.w3-modal:not(:target) { display: all; } </style> </head> <body> <div class="w3-container w3-center"> <div> <div class="w3-container"> <h1 class="tinted-image-white"><b>Special Events</b></h1> </div> <div class="w3-twothird w3-padding"> <div class="w3-card w3-padding w3-round-xlarge tinted-image-white"> <p>The following is a list of Special Events.</p> </div> <br> <div class="w3-card w3-padding w3-round-xlarge tinted-image-white"> <h5> <a href="#Event1">Event1</a><br> <a href="#Event2">Event2</a><br> <a href="#Event3">Event3</a><br> <a href="#Event4">Event4</a><br> <a href="#Event5">Event5</a> </h5> </div> </div> <div class="w3-third w3-center w3-padding"> <div class="tinted-image-white w3-center w3-padding w3-round-xlarge"> <h5>Some important</h5> <hr> <h5>will be posted</h5> here later </div> </div> </div> </div> <!-- Event1 --> <div class="w3-container"> <div id="Event1" class="w3-modal"> <div class="w3-modal-content w3-animate-zoom"> <div class="w3-container"> <span class="w3-button w3-display-topright">&times;</span> <h4>Event1</h4> Event information <p class="w3-right"><a href="#">Close</a></p> </div> </div> </div> </div> <!-- Event2 --> <div class="w3-container"> <div id="Event2" class="w3-modal"> <div class="w3-modal-content w3-animate-zoom"> <div class="w3-container"> <span class="w3-button w3-display-topright">&times;</span> <h4>Event2</h4> Event information <p class="w3-right"><a href="#">Close</a></p> </div> </div> </div> </div> <!-- Event3 --> <div class="w3-container"> <div id="Event3" class="w3-modal"> <div class="w3-modal-content w3-animate-zoom"> <div class="w3-container"> <span class="w3-button w3-display-topright">&times;</span> <h4>Event3</h4> Event information <p class="w3-right"><a href="#">Close</a></p> </div> </div> </div> </div> <!-- Event4 --> <div class="w3-container"> <div id="Event4" class="w3-modal"> <div class="w3-modal-content w3-animate-zoom"> <div class="w3-container"> <span class="w3-button w3-display-topright">&times;</span> <h4>Event4</h4> Event information <p class="w3-right"><a href="#">Close</a></p> </div> </div> </div> </div> <!-- Event5 --> <div class="w3-container"> <div id="Event5" class="w3-modal"> <div class="w3-modal-content w3-animate-zoom"> <div class="w3-container"> <span class="w3-button w3-display-topright">&times;</span> <h4>Event5</h4> Event information <p class="w3-right"><a href="#">Close</a></p> </div> </div> </div> </div> </body> </html>
  5. Tim32

    pass parameter to activate onclick

    Thank you for pointing this out. I was not aware that you could pass the onclick with a href. I have tried: <a href="Events.php" onclick="document.getElementById('Event1').style.display='block'">Event1</a><br> <a href="Events.php" onclick="Event1">Event1</a><br> <a href="Events.php" onclick="getElementById('Event1').style.display='block'">Event1</a><br> <a href="Events.php" onclick="document.getElementById('Event1')">Event1</a><br> along with a dozen other variations but I can't get it work.
  6. Tim32

    pass parameter to activate onclick

    This is my index.php which is calling the Events.php page. What I want to happen is when the user clicks on Event1 from the index.php, it opens Events.php and brings up the Event1 information. The code I have posted does this except for bringing up the Event1 information. I have to click on Event1 in the Events.php to see the information. <!DOCTYPE html> <html lang="en"> <title>Intranet</title> <div class="w3-container parallax"> <div class="w3-container"> <h1 class="tinted-image-white w3-round-xlarge"><b>Important Events you must attend this week!</b></h1> </div> <div> <a href="Events.php#Event1">Event1</a><br> <a href="Events.php#Event2">Event2</a><br> <a href="Events.php#Event3">Event3</a><br> <a href="Events.php#Event4">Event4</a> </div> </div> </body> </html>
  7. Tim32

    pass parameter to activate onclick

    I am sorry but I don't understand what you are looking for.
  8. Tim32

    pass parameter to activate onclick

    http://intranet.me.local/Events.php#Event2
  9. First let me say that the only php code in the file is an include which has no bearing on my question. I have a Events.php file which uses onlclick and javascript to show upcoming events that works well. I now need to be able to call Events.php and have a specific element open from my index.php. Usually I would just add <a href="Events.php#Event2">Event2</a> but that doesn't activate the onclick which displays the information. What are my options? Here is my Events.php file: <!DOCTYPE html> <html lang="en"> <title>Special Events</title> <?php include('/website/_style_include.php'); ?> <body ONKEYDOWN="if (event.keyCode == 27){ document.getElementById('Event1').style.display = 'none'; document.getElementById('Event2').style.display = 'none'; document.getElementById('Event3').style.display = 'none'; document.getElementById('Event4').style.display = 'none'; document.getElementById('Event5').style.display = 'none';}"> <div class="w3-container w3-center"> <div> <div class="w3-container"> <h1 class="tinted-image-white"><b>Special Events</b></h1> </div> <div class="w3-twothird w3-padding"> <div class="w3-card w3-padding w3-round-xlarge tinted-image-white"> <p>The following is a list of Special Events.</p> </div> <br> <div class="w3-card w3-padding w3-round-xlarge tinted-image-white"> <h5> <a href="#" onclick="document.getElementById('Event1').style.display='block'">Event1</a><br> <a href="#" onclick="document.getElementById('Event2').style.display='block'">Event2</a><br> <a href="#" onclick="document.getElementById('Event3').style.display='block'">Event3</a><br> <a href="#" onclick="document.getElementById('Event4').style.display='block'">Event4</a><br> <a href="#" onclick="document.getElementById('Event5').style.display='block'">Event5</a> </h5> </div> </div> <div class="w3-third w3-center w3-padding"> <div class="tinted-image-white w3-center w3-padding w3-round-xlarge"> <h5>Some important</h5> <hr> <h5>will be posted</h5> here later </div> </div> </div> </div> <!-- Event1 --> <div class="w3-container"> <div id="Event1" class="w3-modal"> <div class="w3-modal-content w3-animate-zoom"> <div class="w3-container"> <span onclick="document.getElementById('Event1').style.display='none'" class="w3-button w3-display-topright">&times;</span> <h4>Event1</h4> Event information <p class="w3-right"><a href="#" onclick="document.getElementById('Event1').style.display='none'">Close</a></p> </div> </div> </div> </div> <!-- Event2 --> <div class="w3-container"> <div id="Event2" class="w3-modal"> <div class="w3-modal-content w3-animate-zoom"> <div class="w3-container"> <span onclick="document.getElementById('Event2').style.display='none'" class="w3-button w3-display-topright">&times;</span> <h4>Event2</h4> Event information <p class="w3-right"><a href="#" onclick="document.getElementById('Event2').style.display='none'">Close</a></p> </div> </div> </div> </div> <!-- Event3 --> <div class="w3-container"> <div id="Event3" class="w3-modal"> <div class="w3-modal-content w3-animate-zoom"> <div class="w3-container"> <span onclick="document.getElementById('Event3').style.display='none'" class="w3-button w3-display-topright">&times;</span> <h4>Event3</h4> Event information <p class="w3-right"><a href="#" onclick="document.getElementById('Event3').style.display='none'">Close</a></p> </div> </div> </div> </div> <!-- Event4 --> <div class="w3-container"> <div id="Event4" class="w3-modal"> <div class="w3-modal-content w3-animate-zoom"> <div class="w3-container"> <span onclick="document.getElementById('Event4').style.display='none'" class="w3-button w3-display-topright">&times;</span> <h4>Event4</h4> Event information <p class="w3-right"><a href="#" onclick="document.getElementById('Event4').style.display='none'">Close</a></p> </div> </div> </div> </div> <!-- Event5 --> <div class="w3-container"> <div id="Event5" class="w3-modal"> <div class="w3-modal-content w3-animate-zoom"> <div class="w3-container"> <span onclick="document.getElementById('Event5').style.display='none'" class="w3-button w3-display-topright">&times;</span> <h4>Event5</h4> Event information <p class="w3-right"><a href="#" onclick="document.getElementById('Event5').style.display='none'">Close</a></p> </div> </div> </div> </div> </body> </html>
  10. @Barand Thank you for the ideas. I didn't know about glob. The createFromFormat is a nice way to convert the string to a date and then change the format. Thank you again, Tim
  11. I have a folder full of documents that contain meeting minutes. Each document is named like this: Board 01-02-1977.pdf Board 01-03-1976.pdf Board 01-07-1975.pdf Board 01-09-1974.pdf Board 02-01-1978.pdf Board 02-03-1979.pdf I need to display the list sorted by y-m-d. I have it working and here is my code so far: <?php $files = array_diff(scandir('./Board'), array('..', '.', 'Default.php', 'template.php')); foreach($files as $file => $item) { $filebreak = preg_split("/(-|\.)/",$item,-1,PREG_SPLIT_NO_EMPTY); $files[$file] = $filebreak[2] . $item; } sort($files); foreach($files as $file) { $file = substr($file,4); echo "<a href='./Board/"; echo $file; echo "'>"; $file = str_replace('.php', '', $file); echo $file; echo "</a><br>"; } ?> I get an arrary of the files using scandir and get rid off the files I don't want to see. Next I take the year and append it to the beginning of the filename and then sort the array. Finally I print the results. What do you guys think? Is there a better way to do this? Did I miss something?
×

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.