/    Sign up×
Community /Pin to ProfileBookmark

popup_values_child_to_parent_Window

[FONT=”Verdana”][SIZE=”2″]Hello friends, help me,?

Actually i have written code for to transfer the values from child window to parent window. It works well in Internet Explorer(IE) and not in FireFox(FF) & Netscape Navigator.

The code follows

[B]Parent code:[/B]
<input name=”product_id” type=”text” value=””>
<input name=”product_name” type=”text” value=””>
<input type=button value=”a..” onClick=”window.open(‘popup.php?action=’,”,’top=100,left=100,width=600,height=450, scrollbars=1′);”>

[B]Child code:[/B]
[FONT=”Verdana”]<input type=”button” onclick=”setValues(‘name’,’id’)”>

<script language=”javascript”>
function setValues(name,id)
{
opener.document.getElementById(“product_name”).value = name;
opener.document.getElementById(“product_id”).value = id;
self.close();
return fals[/FONT]e;
}
[/SIZE][/FONT]

to post a comment
JavaScript

8 Comments(s)

Copy linkTweet thisAlerts:
@FangJun 06.2007 — "product_name" is not an id. Either add the ids to the form controls or reference the controls using: [I]opener.document.formName.product_name.value = name;[/I]
Copy linkTweet thisAlerts:
@vinssoftauthorJun 06.2007 — Actually the expectation is: to make the application to work in all the browsers
Copy linkTweet thisAlerts:
@vinssoftauthorJun 06.2007 — The code is working in IE explorer as by passing value from child to parent.

but in the firefox the value is not passing.
Copy linkTweet thisAlerts:
@FangJun 06.2007 — If the user does not allow you to open a window, your code will never function correctly
Copy linkTweet thisAlerts:
@vinssoftauthorJun 06.2007 — Mr fang, could u able to help me now
Copy linkTweet thisAlerts:
@FangJun 06.2007 — You object references are incorrect, as I wrote.
Copy linkTweet thisAlerts:
@vinssoftauthorJun 06.2007 — i am testing that site, the popup i working, but not transmitting the values, how to make it to do,
Copy linkTweet thisAlerts:
@vinssoftauthorJun 06.2007 — thanks mr fangs it works well
×

Success!

Help @vinssoft spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...