Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
|
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 12th, 2007, 02:29 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 119
Thanks: 0
Thanked 1 Time in 1 Post
Default How to set hidden field value AFTER page reloads

These are steps I need to take in order to maintain a connection between a parent window and its child window:

1. User comes in to parent window where the hidden field value is set to "" and makes some changes to the form.
2. User clicks on a button to bring up a popup window but I need to save the changes he made to the parent window first.
3. I use javascript to update the parent window and then the parent window is reloaded with the user's changes.

HERE IS MY PROBLEM:
4. I then have to change the hidden field value on the reloaded form.

5. Check the value of the hidden field value.
6. Run the function that then opens a popup window from that reloaded form and therefore keeping all the values I need to pass on to the popup window.

How do I accomplish step #4?

I have been trying to get around this issue in various ways but to no avail. Any help or direction would be greatly appreciated.

Thanks.
 
Old June 12th, 2007, 06:35 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

Your process sounds over complicated. I think I understand what you are trying to do however do not understand why you would do it this way. If I may ask, why do you need the child window?

Wind is your friend
Matt
 
Old June 12th, 2007, 08:25 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 119
Thanks: 0
Thanked 1 Time in 1 Post
Default

You are absolutely correct that this is an overly complicated process. Why I need it to work this way is because when the parent form is saved with the changes that the user made, the customer then wanted the process to then open a pop-up window so that they can add Items to the requisition which is the parent window and then I pass back the info in the child window to the parent window.

That is the reason I need this to work. Hope that helps. Is there any way to accomplish what I'm needing to do. The hidden field was the only thing I could think of whereby I could note if I'm in the parent window when it is executed originally or after it has been reloaded. I'm open to any other way to detect whether a page has been reloaded based on event that has taken place and then allowing me to open the pop-up window I'm needing.
 
Old June 13th, 2007, 02:02 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Well you get a reference to the field using either document.getElementById() or document.forms[0].elements[0] or whatever and then set the element's value attribute.

--

Joe (Microsoft MVP - XML)
 
Old June 13th, 2007, 05:47 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 119
Thanks: 0
Thanked 1 Time in 1 Post
Default

Joe,

Thanks for the reply. However, how do I change that element when the page is "reloaded". I want the page, when accessed originally, to have the hidden field with a value of "". Then when the page is reloaded, set the value to "whatever" so then I can run the function that then brings up the popup window.

I hope that makes sense.

Thanks again!
 
Old June 13th, 2007, 10:13 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 119
Thanks: 0
Thanked 1 Time in 1 Post
Default

We finally got this to work. We are using the Stripes framework within our java environment and because Stripes can maintain state we were finally able to reset the hidden field value.

Thanks for the replies and time.

Regards.





Similar Threads
Thread Thread Starter Forum Replies Last Post
pass value to the hidden field Dejitan ASP.NET 1.0 and 1.1 Basics 4 December 21st, 2006 03:13 AM
Hidden Field value error - PLEASE HELP jroxit Classic ASP Basics 5 September 18th, 2006 05:46 AM
Hidden field ashoka_klt ASP.NET 1.0 and 1.1 Basics 1 September 6th, 2006 07:12 AM
Validating a hidden field mkerchenski ASP.NET 1.0 and 1.1 Basics 1 June 3rd, 2004 11:20 AM
How to assign a value to a hidden field? Edward King Javascript How-To 1 May 3rd, 2004 07:36 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.