Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional 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
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 8th, 2006, 10:07 PM
Authorized User
 
Join Date: Jun 2005
Location: , , .
Posts: 21
Thanks: 0
Thanked 0 Times in 0 Posts
Default urgent help on javascript

I have a web page, say Page1.aspx containing 2 controls - a textbox and a button.
i click the button to open another page say Page2.aspx, using window.showModalDialog containing another textbox and a button.
i type something on this textbox and click the button on Page2.aspx.
what i need is that Page2.aspx should close and whatever was typed on the it's textbox should get copied to the textbox on Page1.aspx

  #2 (permalink)  
Old January 9th, 2006, 12:27 AM
Friend of Wrox
Points: 4,332, Level: 27
Points: 4,332, Level: 27 Points: 4,332, Level: 27 Points: 4,332, Level: 27
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2003
Location: , NJ, USA.
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

Set the value on page2.aspx into a session variable, then on page1, reference the session variable.

Jim

  #3 (permalink)  
Old January 13th, 2006, 05:10 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Or you could emit javascript that does something like this:

window.opener.forms[0].textbox1.value = "<value from source textbox>"

-Peter
  #4 (permalink)  
Old January 13th, 2006, 05:15 PM
Friend of Wrox
Points: 4,332, Level: 27
Points: 4,332, Level: 27 Points: 4,332, Level: 27 Points: 4,332, Level: 27
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2003
Location: , NJ, USA.
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

even better way.. nice peter..

  #5 (permalink)  
Old January 13th, 2006, 05:30 PM
Friend of Wrox
Points: 4,332, Level: 27
Points: 4,332, Level: 27 Points: 4,332, Level: 27 Points: 4,332, Level: 27
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2003
Location: , NJ, USA.
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

Peter.. I just tried it..can't get it to work.. I get a js error but i can't view it.. just does nothing...

  #6 (permalink)  
Old January 13th, 2006, 05:51 PM
Friend of Wrox
Points: 4,332, Level: 27
Points: 4,332, Level: 27 Points: 4,332, Level: 27 Points: 4,332, Level: 27
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2003
Location: , NJ, USA.
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

Never mind, you just need to add "document." before forms[0]

window.opener.document.forms[0].textbox1.value = "<value from source textbox>"


  #7 (permalink)  
Old August 2nd, 2006, 03:53 PM
Registered User
 
Join Date: Aug 2006
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks a lot for this piece of code, people!!

  #8 (permalink)  
Old August 2nd, 2006, 04:21 PM
Registered User
 
Join Date: Aug 2006
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

this code works beautifully on IE but on Firefox, it doesn't!!:(
help!

  #9 (permalink)  
Old August 2nd, 2006, 07:59 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

First modalDialogs are pointless on XP machines that have their preformance settings adjusted for best preformance (read as, circa windows 98 feel). DotNetGirl, whats the js error?

"The one language all programmers understand is profanity."
  #10 (permalink)  
Old August 3rd, 2006, 01:23 AM
Authorized User
 
Join Date: Oct 2004
Location: Bangalore, , India.
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default

In Firefox showModalDialog won't work. You can use window.open to support all the browsers

Tell me what you need and i will tell you how to get along without it.
-----------------------------------------------------------------
Ratheesh
Bangalore, INDIA
ratheesh1982@gmail.com
 


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
Urgent:Javascript ivanlaw Javascript How-To 5 September 4th, 2007 08:18 PM
Flash and Javascript (VERY URGENT) Apocolypse2005 Javascript 3 July 2nd, 2006 02:12 PM
How to load c++ dll using javascript(urgent) faisal79 Javascript 1 May 30th, 2006 07:51 PM
Urgent help in javascript madhu Javascript How-To 1 October 21st, 2004 04:37 PM



All times are GMT -4. The time now is 02:43 AM.


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