Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 12th, 2007, 02:29 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Arlington, TX, USA.
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.
Reply With Quote
  #2 (permalink)  
Old June 12th, 2007, 06:35 PM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
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
Reply With Quote
  #3 (permalink)  
Old June 12th, 2007, 08:25 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Arlington, TX, USA.
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.
Reply With Quote
  #4 (permalink)  
Old June 13th, 2007, 02:02 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
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)
Reply With Quote
  #5 (permalink)  
Old June 13th, 2007, 05:47 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Arlington, TX, USA.
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!
Reply With Quote
  #6 (permalink)  
Old June 13th, 2007, 10:13 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Arlington, TX, USA.
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.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 03:32 PM.


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