assign control value from javascript

  • Thread starter Thread starter soni2926
  • Start date Start date
S

soni2926

Hi,
I have a popup window that i need to populate the hidden field in with
the url of the page that called it. I know i can use javascript ->
opener.location to get the url of the page that called the window, how
do i now place this into the value of an hiddenfield and have it
available in the onload of the page?
i tried something like:
<input type="hidden" id="subject" name="subject" runat="server"
value="<script language=javascript>document.write(opener.location')</
script>" />
but that didn't work. Is there any way to do this? Or anyway function
i can call in the onload method to know the page that called the
popup?
Thanks.
 
For a simple hidden tag, you can find the control via JavaScript (GetByID
comes to mind) and set the value of the control. IT gets more complex with
ASP.NET Server controls, but even those are easy enough to handle by
emitting JavaScript from the control.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com

*********************************************
Think outside the box!
*********************************************
 
Back
Top