473,549 Members | 2,935 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Refresh a Modal Popup

14 New Member
Hi, I'm using functions in PHP, along with small snippets of Javascript, to design a Calendar. It should popup with the month, you should be able to pick a week, and then choose a day to add scheduled events to.

My problem right now is that I'm attempting to refresh a modal when I switch months, weeks, or days without flushing everything. I want to change what is between the <p> marks where the id is "showMo". Here is an example of what I am doing:

Expand|Select|Wrap|Line Numbers
  1. <div id="idMo" class="w3-modal">
  2.   <div class="w3-modal-content w3-card-8">
  3.     <header class="w3-container w3-teal"> 
  4.       <span onclick="document.getElementById('idMo').style.display='none'" 
  5.       class="w3-closebtn">&times;</span>
  6.       <h2><span onclick="<? $mo--; ?><script>document.getElementById('idMo').style.display='block'</script>">&lt;</span>
  7.     <span onclick="<? $mo++; ?><script>document.getElementById('idMo').style.display='block'</script>">&gt;</span></h2>
  8.     </header>
  9.     <div class="w3-container">
  10.       <p id="showMo"><? drawCalendar(date($mo,$Y)) ?></p>
  11.     </div>
  12.     <footer class="w3-container w3-teal">
  13.       <p>Copyright - <? echo date(Y); ?></p>
  14.     </footer>
  15.   </div>
  16. </div>
If someone could help me, that'd be great. Thanks!
Apr 11 '16 #1
1 2265
aunk
14 New Member
Hi, I answered my own question. I found out that we can use a small snippet of javascript to make the <span></span> code change, or in this case, the <p></p> tags.

Here's how I did it:

Expand|Select|Wrap|Line Numbers
  1. <div id="idMo" class="w3-modal">
  2.   <div class="w3-modal-content w3-card-8">
  3.     <header class="w3-container w3-teal"> 
  4.       <span onclick="document.getElementById('idMo').style.display='none'" 
  5.       class="w3-closebtn">&times;</span>
  6.       <h2><span onclick="<? $mo--; echo '<script>document.getElementById("showMo").innerHTML = ' . drawCalendar(date($mo,$Y)); . '"</script> ' ?>&lt;</span>
  7.     <span onclick="<? $mo++; echo '<script>document.getElementById("showMo").innerHTML = ' . drawCalendar(data($mo,$Y)); . '"</script> ' ?>&gt;</span></h2>
  8.     </header>
  9.     <div class="w3-container">
  10.       <p id="showMo"><? drawCalendar(date($mo,$Y)); ?></p>
  11.     </div>
  12.     <footer class="w3-container w3-teal">
  13.       <p>Copyright - <? echo date(Y); ?></p>
  14.     </footer>
  15.   </div>
  16. </div>
Apr 11 '16 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
1497
by: BillE | last post by:
I created a modal popup form with a button, a label, an OK Button, and a Cancel button. The first button updates the label text on postback. When I click the first button, the modal popup closes, as if I had clicked the OK or Cancel button. How can I keep the modal popup active after postback? Thanks Bill
3
10551
by: Not Me | last post by:
Hey, I'm using the MS AJAX libraries to achieve a modal popup window. Prior to using the toolkit control, I have a gridview and detailsview objects visible on the page.. when the gridview row is selected, the detailsview updates (in a seperate updatepanel - no full refresh) Now I've added the modalpopupextender and the result is that...
1
2934
by: Samuel Rhodes | last post by:
hi i am using a ajax modal popup to allow the user to search an item and select the required item from the list. whenever i try to search the item, which causes a post back....the modal popup disappears/becomes invisible... in general, any postback fired from within the modal popup makes the modal popup disappear.
0
1666
by: =?Utf-8?B?QWxCcnVBbg==?= | last post by:
I have a situation in which I need to check for data in either of two fields and display an alert if neither field contains data or if both fields contain data when the user clicks on a View button; these two fields are for Member Number and for Social Security Number. I have written a Javascript function to handle that situation. A new...
1
3277
rrocket
by: rrocket | last post by:
I am trying to get a modal popup to display on an onblur event, but I keep getting a "'null' or is null or not an object" js error. I have seen many examples using var _popup; _popup = $find('MPE'); _popup._show(); //And $find('MPE')._show(); //And
16
11078
malav123
by: malav123 | last post by:
Hi, I am using Ajax's modal popup extender to display the information about all the rows of gridview but the problem is when page loads, modal popup extender loads for all the rows... but i want to implement the same as when i request for particular row at that time modal popup should be load.... because it's take so much...
10
4313
malav123
by: malav123 | last post by:
Hi, In my master page i have right pannel, in which i am using the user control and collapsiblePanelExtender and in that right panel there is one link button named "Event", so if user clicks on that link button then the modal popup extender will be displayed... all thing is working well but when modal popup extender displays...
4
2313
by: fran_j_diaz | last post by:
Hi, I have a page with an Ajax modal popup. I would like to know when my Modal popup is opened, my page still able to modify. Is it possible ? (I use Visual Studio 2005, c# )
3
3868
by: Mike Hofer | last post by:
Okay, here's the situation: we want to be able to display ASPX pages in an UpdatePanel. The reasons for this are performance related. The site in development uses *lots* of modal popups from some pages, and we don't want to load all that content until it's requested. So, what we want to do is place an IFRAME inside an UpdatePanel and, in...
5
10850
by: =?Utf-8?B?SmFtZXMgUGFnZQ==?= | last post by:
Hi all Have a couple of issues with the modal popup extender (asp.net 3.5, vb.net, visual studio 2008): I have created a user control (e-mail enquiry form) which is designed to accept text input then send an e-mail. The user control has 2 views – view 1 –e-mail input form, view 2 confirmation that e-mail has been sent.
0
7518
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7956
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7469
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7808
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6040
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5087
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3480
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1935
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1057
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.