|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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 |
|
#2
|
||||
|
||||
|
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>
|
|
#3
|
|||
|
|||
|
Thank you so much! It worked! :-)
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > Passing a variable to opener href |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|