473,657 Members | 2,652 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

pass value from one html page to another?

nirmalsingh
218 New Member
hai experts,
i am having page called main.html, when the user clicks a button in this page a popup window of pop.html is opened. in pop.html user enter his name and close that popup window.
now what i need is:
the name entered in pop.html shiould be shown as table format in main.html. the row should be added each and every time the user open and enter a name.
without refreshing main.html. what should i do for this.
Feb 14 '07 #1
16 47306
dmjpro
2,476 Top Contributor
plz try this code .......

in main.html
=============== ==
Expand|Select|Wrap|Line Numbers
  1. //ur code
  2. <table id = my_tab>
  3. </table>
  4. //ur code
in pop.html
=============== ==
Expand|Select|Wrap|Line Numbers
  1. <body onbeforeunload = passMain()>
  2. <input type = text id = ur_name>
  3. </body>

in pop.js file
=============== ===
Expand|Select|Wrap|Line Numbers
  1. function passMain()
  2. {
  3.   var cell_obj = window.opener.document.getElementById('my_tab').insertRow().insertCell()
  4.   cell_obj.innerHTML = doument.getElementById('ur_name').value;
  5. }
  6.  
if u close or refresh the popup html the row will be inserted in main.html

plz send ur response

i am online
Feb 14 '07 #2
nirmalsingh
218 New Member
no reaction in main.html.
my code:main.html
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <body>
  3. <table id = my_tab>
  4. </table>
  5. </body>
  6. </html>
pop.html
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <head>
  3. <script language="javascript" src="pop.js">
  4. </script>
  5. </head>
  6. <body onbeforeunload = "passMain();">
  7. <input type = 'text' id = 'ur_name'>
  8. </body>
  9. </html>
pop.js
Expand|Select|Wrap|Line Numbers
  1. function passMain()
  2. {
  3. var cell_obj = window.opener.document.getElementById('my_tab').in sertRow().insertCell()
  4. cell_obj.innerHTML = doument.getElementById('ur_name').value;
  5. }
  6.  
Feb 14 '07 #3
acoder
16,027 Recognized Expert Moderator MVP
In IE, you will need a tbody, so in main.html:
Expand|Select|Wrap|Line Numbers
  1. <html>
  2. <body>
  3. <table id = my_tab>
  4. <tbody id="mytb"></tbody>
  5. </table>
  6. </body>
  7. </html>
and in pop.js:
Expand|Select|Wrap|Line Numbers
  1. function passMain()
  2. {
  3. var cell_obj = window.opener.document.getElementById('mytb').insertRow().insertCell();
  4. cell_obj.innerHTML = doument.getElementById('ur_name').value;
  5. }
Feb 14 '07 #4
nirmalsingh
218 New Member
still no reaction.
Feb 14 '07 #5
acoder
16,027 Recognized Expert Moderator MVP
Sorry, typo. Try:
Expand|Select|Wrap|Line Numbers
  1. function passMain() {
  2. var cell_obj = window.opener.document.getElementById('mytb').insertRow().insertCell();
  3. cell_obj.innerHTML = document.getElementById('ur_name').value;
  4. }
Feb 14 '07 #6
dmjpro
2,476 Top Contributor
always try to write while u coding js .........

Expand|Select|Wrap|Line Numbers
  1. try
  2. {
  3.  //ur code
  4. }catch(err)
  5. {
  6.  alert(err.description);
  7. }
then u can trap the error

now plz check out the case_sensitive id_name my_tab and mytb in main.html and pop.js
Feb 14 '07 #7
nirmalsingh
218 New Member
hi experts,
can i send data from one html page to another just like
main.html?id=sa mple&data
if yes, how can i retrieve those data by javascript?
Feb 15 '07 #8
acoder
16,027 Recognized Expert Moderator MVP
Use location.search and parse it for your values.
Feb 15 '07 #9
nirmalsingh
218 New Member
hi experts,
i am having 2 html pages.
1.main.html
2.sub.html

in main.html, when i click a button, sub.html should open in a popup. the user will fill datas in sub.html and close the window. the filled data should be displayed as a table(in main.html along with edit and delete button on each row) at each and every time the user open popup and close. atlast i should be able to edit data by clicking edit button and popup should be opened to edit and after i close the popup, the edited data should be updated, and by clicking delete button current row should be deleted. and at final stage i need the datas in a string to save it in a database.
i hope u understood my problem.
Feb 16 '07 #10

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

Similar topics

1
4801
by: zdhiu | last post by:
Hi javascript gurus, I have a simple html file (simple.html) with javascript. In html page there is sentence from variable defined in .js file (myFirst.js). Once I reload another .js file (mySecond.js), the value defined in the second one is NOT reloaded into html page. Please help out what's wrong in my code. BTW, I use IE6.0
27
6188
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 done? regards, Oscar
1
1943
by: Simon Lee | last post by:
Dear all, I write a following form in the html page and link to the webpage without scrollbar,menubar, with a fixed size as follow: ------------------------- <form name="formsearch" method="post" action="/update/search.php" target="new" onSubmit="return CheckForm2()"><input type="hidden" name="PHPSESSID" value="f7092b1e7077d992e854d60c797084f9" /> <div valign=center>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b> <font size=1 ...
7
2444
by: SteveM | last post by:
I am sure this is an easy question, but being relatively new to ASP.NET programming, I can not quite grasp what I need to accomplish what I need to do. What I have is a word document that is rendered as a page (or actualy a part of a page) that is editiable. To do this I let the user download the document, edit it and then upload it back to the site. Then at Page_Open, I convert the .doc file to an html and render it back to the page......
2
2108
by: justplain.kzn | last post by:
Hi, I have a table with dynamic html that contains drop down select lists and readonly text boxes. Dynamic calculations are done on change of a value in one of the drop down select lists. Using Safari,my first iteration the script works fine ( indicating that there are 33 form variables ). When trying another dropdown select value, the
2
2172
by: HHAAPPYY | last post by:
Hi I am trying to pass value of the textbox along with another value to the query string. when i am retriving the txtbox value it always shows me null, my senario is like this On my page div_admin.asp i have following things.<% Dim page, content,console,banner,navbar
10
3456
by: paulie | last post by:
Hi, I have been experiencing an issue when trying to use AJAX to reload a DIV area using a timer of 2000ms, which contains a html page with another DIV and javascript. Scenario ------------- I have perl script which simply runs a ps on a Solaris server and generates a static html page with all of the code perfectly and this html page works fine when viewing it statically or with a META REFRESH header tag. The idea is to give the user...
1
2767
by: Arpit Nagar | last post by:
Hi... I am creating a dummy project for collage. Here I had choosen my project as Jewelleryshoping. Now the scenerio is like that thier are jewellry item which I had display in table format with images using form tag for button. Now the case is like I dont want to use any database like sql,serversite,php etc. I just want to use html or javascript or extremely XML. Now I want that When any person select Add to cart to particular...
7
4288
by: cartercc | last post by:
I think I already know the answer to this one, but I'm giving it the old college try. My problem is this: I have an HTML form that sends a bunch of data to a Perl script, where it is validated and read into a database. The powers that be have decided in their infinite wisdom that the initial page needs to be broken into two parts. (This is an attempt to correct some common user errors, not because of any technical reasons.) So I'm...
1
1184
by: zedetach | last post by:
I have inserted a function to help me pass a value from one html page to a drop down box in another html page. The problem is the code is working only in IE and not in Firefox. The code in the first page :- <a href="reservation.html?rooms=0">Book Now</a> The code in the 2nd page :- <script type="text/javascript"> function parseState()
0
8392
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8732
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7324
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6163
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4151
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4302
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1953
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1611
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.