/    Sign up×
Community /Pin to ProfileBookmark

identify parent button

I hve 5 buttons on a page on click of any button a new window opens.

Now, New window has a text box and a button.

I type something in text box and onclick of new window’s button i want that
-the value of button of parent window which opned child window
shd change to value i entered in text box.
Hope i am clear…!!
PLz help…
Retesh

to post a comment
JavaScript

8 Comments(s)

Copy linkTweet thisAlerts:
@KorMar 06.2004 — new window opens as a window.open() style (pop-up) or as a iframe/frame style?
Copy linkTweet thisAlerts:
@retesh_gondalauthorMar 06.2004 — new window opens as:

window.open()
Copy linkTweet thisAlerts:
@KorMar 06.2004 — [b]window.opener[/b] is the reference which will fire or find the function or object on opener ("parent") page.

Example in attachment

[upl-file uuid=603852cc-54d2-4a81-90b9-79f74201b79a size=593B]exemple.zip[/upl-file]
Copy linkTweet thisAlerts:
@retesh_gondalauthorMar 06.2004 — Your code is perfect...but my problem is... i hve 5 buttons ...now watever button i click i shd sent value back to that button only...u hve specifically mentioned buttons name "b1" in "index.html"....but i want that popup window shd automatically recognise which button invoked it and only that buttons value shd be changed.
Copy linkTweet thisAlerts:
@KorMar 06.2004 — use another parameter

in opener

[code=php]
<script>
function bla(a,b){
document.forms[0].elements[b].value = a;
}
</script>
[/code]


in first opened page

<input type="text" onkeyup="window.opener.bla(this.value,'b1')">

in second

<input type="text" onkeyup="window.opener.bla(this.value,'b2')">

... aso

and gives your buttons names b1, b2... Or whiever name you want, but keep the correspondence between names and second parameter passed to the function
Copy linkTweet thisAlerts:
@retesh_gondalauthorMar 06.2004 — tnx for all the help...!! finally..something worked...although not wat i wanted...but..its done...thx again..!!
Copy linkTweet thisAlerts:
@KorMar 06.2004 — what stops you to say what exactly you want...??
Copy linkTweet thisAlerts:
@retesh_gondalauthorMar 06.2004 — Actually i made hve made my own a calender....!!

Earlier i had used a free script of calender and in that script i was not asked to mention buttons name anywhere. Now that i made my own calender i also wanted to implemetnt it same way ....that is just call a function that will popup a new window select a date and close it it will automatically sendvalue to the control(button) ...!!

Now that wilth your help i am able to implement the same but i hve to mention buttons name...!!

If u r able to observewat i really want and if u can help i'll be greatful for ur support...!!

Thanx again...!!

Retesh
×

Success!

Help @retesh_gondal 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 5.28,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...