473,320 Members | 1,820 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

how to pass php value from one div to another div within same page

1
how to pass php value from one div to another div within same page
Oct 30 '14 #1
1 6848
Claus Mygind
571 512MB
It appears you are asking how to move something after the page has been streamed out from the web server to the client computer.

If that is the case, that cannot be done with php. php does not execute on the client computer, you have to use javaScript to do that.

And if that is your question there are several ways to do that. Here is one example not necessarily the best, but it demonstrates what I think your question is.
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3.  <head>
  4. <script type="text/javascript">
  5.  <!--
  6.     function moveContentTo2()
  7.     {
  8.         document.getElementById("div2").innerHTML = document.getElementById("div1").innerHTML;
  9.         document.getElementById("div1").innerHTML = '';
  10.     }
  11.     function moveContentTo1()
  12.     {
  13.         document.getElementById("div1").innerHTML = document.getElementById("div2").innerHTML;
  14.         document.getElementById("div2").innerHTML = '';
  15.     }
  16.  
  17.  //-->
  18.  </script> </head>
  19.  
  20.  <body>
  21.     The value in div 1 is
  22.     <div id="div1">Move this text</div>
  23.     The value in div 2 is    
  24.     <div id="div2"></div>
  25.     <input type="button" value="Move content to div 2" onclick="moveContentTo2()">
  26.     <input type="button" value="Move content back to div 1" onclick="moveContentTo1()">
  27.     </body>
  28. </html>
  29.  
Oct 30 '14 #2

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

Similar topics

2
by: luu duong | last post by:
I know this is probably easy but here is the details. I have an asp page that is not inside a frameset. I want to post data to another asp page that is inside a frameset. So firstpage.asp has...
27
by: Oscar | last post by:
I am looking for a way to pass an ADO recordset that has been retrieved in an ASP page to another HTML-page. Is there someone who can provide me with a small sample or a link to see how this is...
3
by: Hermit Dave | last post by:
Hi, Trying to pass a value to user control within a page. 1. Couldnt find a way to pass it from code behind file. 2. Trying to pass it from aspx page... using EditURL='<% "mypage.aspx?myvar=" +...
2
by: c676228 | last post by:
Hi, This is my first time to post asp.net question on this forum. I have a question for "How to pass the first form value to the next form" I have enrollinfo.aspx form which look like as follow:...
0
by: jenileo | last post by:
My set up: Issue Tracking App Summary Page: 1. Drop Down bound to Table A LogID for user selection. 2. Upon drop down selection, DetailsView exposes Table A records, read only and a Grid...
17
by: Rabbit | last post by:
Hi, On my 1st page, i have a function which gets a new ID value and need to transfer to another immediately. which I want to get in 2nd page using Request.form("txtID"), but doesn't work, the...
4
by: RipperT | last post by:
College newbie here (Instructor MIA). I have instructions to pass variable values from one web page to another like this (VS2005): 1. Declare and create the properties on the first page (source...
2
by: sarsat | last post by:
Hello, Am very new to php.. I don't know how to pass a value from one page to another page in php.. can any one help me...
1
by: thirusvga | last post by:
i create a login page and slide show program .. after entering user we fetch slide in slide table using uid..please help me..
3
by: nse111 | last post by:
I use PHP sessions to pass a value from one page to another. In my 1st page I pass a value called 'id' to my 2nd page using a hyperlink. explained: <a href="abc.php?id=<?php...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.