JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old May 17th, 2004, 05:12 AM
gbaia gbaia is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 24 gbaia User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Passing a variable to opener href

Hello!

I have a pop-up and from this pop-up I want the opener window to have a different URL variable.

Basically, this is my opener url:
http://localhost/admin/customers.asp?Customer_ID=2

And the pop-up brings a list with different Customer_ID... what I want is that when he clicks on the customer, the url changes:
So that the opener url will be, for example:
http://localhost/admin/customers.asp?Customer_ID=3

I've done the below, but, I don't know how to say to window.opener.location.href that the new Customer_ID is value 3 or whatever it will be.

function ChooseCustomer(value1)
{ window.opener.location.href
window.close(); }

link:
<a href="Javascript;" onClick="ChooseCustomer(<%=ChildRS.Fields.Item("Customer_ID").Value%>);">
<%=ChildRS.Fields.Item("Customer_Name").Value%></a>

Thank you so much!!! Grazi

Reply With Quote
  #2  
Old May 17th, 2004, 06:16 AM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 6 m 11 sec
Reputation Power: 8
Send a message via ICQ to stumpy Send a message via MSN to stumpy
Give this a shot
Code:
<script type="text/javascript">
function listCustomers(custid) {
  window.opener.location.href = 'listcustomers.asp?customerid=' + custid
  this.close()
}
</script>

<%
varCustID = ChildRS.Fields.Item("Customer_ID").Value
varCustName = ChildRS.Fields.Item("Customer_Name").Value
%>
<a href="#" onClick="listCustomers('<%=varCustID%>')"><%=varCustName%></a>
__________________
DevArticles Moderator
BlueSix - Web Development and Consulting

Reply With Quote
  #3  
Old May 17th, 2004, 06:39 AM
gbaia gbaia is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: May 2004
Posts: 24 gbaia User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thank you so much! It worked! :-)

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > Passing a variable to opener href


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway