[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Reload data in div tag

Posted on 2013-01-07
11
Medium Priority
?
413 Views
Last Modified: 2013-01-17
I have a php page with two <div>'s in which I load external php pages. They load fine, but when I try to do a submit in one of the external files, the parent page is populated with only the form data from the div tag page. I thought it would be the same as an iframe but apparently not!
I have the external php page set up like a full html page with form and form action etc. Not sure how to get this working . I had the data in an iframe but I need to do an auto reload every 10 second and I don't want the iframe to reload, hence I'm using a series of <div> that I can refresh individually.
0
Comment
Question by:kevbob650
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
11 Comments
 
LVL 8

Expert Comment

by:Barry62
ID: 38751627
If you have the action of your external forms set to the parent page, you will need to create and populate hidden fields in the external forms for the data you want to re-populate on the parent page.  PHP will only keep data from the currently submitted form.

You could use cookies to keep your parent page data.
0
 

Author Comment

by:kevbob650
ID: 38751915
I was thinking I would have the action of the external page to be itself as I would in an iframe application. So do I need to set the action to the parent page?
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 38752261
Can you post a like to the page? It sounds like the structure is invalid which will probably create all kinds of problems anyway.

Cd&
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:kevbob650
ID: 38752516
I can't get you a link, but here's the structure (can't seem to attach a file?)...



Parent page:

<html>
<head>
<script type=”text/javascript”>
$(document).ready(function(){
      $("#dailyCounts").load("dailyCounts.php");
      $("#countSummaries").load("countSummaries.php");
      $("#history").load("history.php");
});
</script>
<table>
    <tr>
             <td>
      <div id=”dailyCounts”></div>
       </td>
       <td>
      <div id=”countSummaries”></div>
       </td>
   </tr>
   <tr>
      <td>
      <div id=”history”></div>
     </td>
   </tr>
</table>


dailyCounts.php
page with mysql, refesh routine updating every 10 seconds:
<script>
    $(document).ready(function() {
        setInterval("location.reload(true)", 10000);  // every 10 seconds        
    });
</script>


countSummaries.php
page with mysql queries
<form> with <select> box and submit to update display
no auto_reload routines


history.php
page with mysql queries
<form>
<select> boxes and submit to update display
and a jqery refresh routine
<script>
    $(document).ready(function() {
        setInterval("location.reload(true)", 30000);  // every 30 seconds        
    });
</script>
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 38752682
I started to do a long winded technical exploration which was getting confused when I realized that this can be put quite simply.  Content in a div can never be a window object.  The content of an iframe is always a window object.  To maintain the context you need, you need the a parent window to child window relationship.

Barry's suggestion of cookies is dicey, but you might be able to make it work.  Trying to make a div behave like an iframe is like expecting a pet dog to run in the Kentucky Derby.

Cd&
0
 

Author Comment

by:kevbob650
ID: 38752734
LOL,  so that being said, what's the best way to accomplish this?  iframes?  if so, how can I prevent the parent page from flickering when the iframes reload?  frustrating!
0
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 1000 total points
ID: 38752779
If the iframe is hidden then there is no need for the page to refresh and that should end the flicker.  Then use scripting to populate a div for display and input.  there shoud be no issue moving things between the main page elements and the iframe as long as you are delivering everything from the same domain.

It is more work to do the extra scripting, but you should be able to get the result you want.

Cd&
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 38788711
What is with the C?  Either it does not give you what you need and we should be looking to see if more can be done, or it solved the problem in which case a C is inappropriate.  


Cd&
0
 

Author Comment

by:kevbob650
ID: 38788814
no it didn't solve the problem, all it did was send me on to other sources, so the C is appropriate
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 38788848
If it did not solve the problem, it should not be accepted at any grade.  If you found a solution elsewhere, post it and ask CS to accept your comment as the answer, or if you don't want to pursue it further then ask them to delete the question.

Cd&
0
 

Author Comment

by:kevbob650
ID: 38788890
this is crap, delete the question. I'll always award an A for every solution in the future.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
Learn the basics of if, else, and elif statements in Python 2.7. Use "if" statements to test a specified condition.: The structure of an if statement is as follows: (CODE) Use "else" statements to allow the execution of an alternative, if the …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question