By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,850 Members | 1,895 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,850 IT Pros & Developers. It's quick & easy.

How to pass a value to a hidden field

P: 93
Hi, i have an asp.net and vb.net web page i am opening a popup window where the user can select somthing. When the user presses select it is suppose to go back to the original form closing the pop up and processing the value the user has chosen. To do this i am using javascript. The problem is how to you tell the pop up to close and pass the value back to the hidden field in the oiginal form where i can do more processing.

Sorry if this does not make sense
Oct 17 '08 #1
Share this Question
Share on Google+
5 Replies


gits
Expert Mod 5K+
P: 5,235
it does make sense ;) ... you just need to assign an onchange-event that sets the new selected value to a field in the opener's document. then just use the window.close() method to close the popup window ...

please show what you have tried so far.

kind regards
Oct 17 '08 #2

P: 93
it does make sense ;) ... you just need to assign an onchange-event that sets the new selected value to a field in the opener's document. then just use the window.close() method to close the popup window ...

please show what you have tried so far.

kind regards
Hello friend window.close may not work in some case specially when you are working in the different frame of the parent page .So, It is always safe to use top.close which will close always the t window which is in the browser where you are working.
Oct 17 '08 #3

gits
Expert Mod 5K+
P: 5,235
thanks to point that out - of course window should refer to the window that should be closed ... you could use it in the parent window or in the popup itself ... so you always should know the correct reference
Oct 17 '08 #4

P: 93
Hi thanks for you replies. I have got most of it working however, i can't seem to pass a hidden field value to the js function the code is bellow

Code:

this.form.hdnStructureID.value

can someone tell me whats wrong with this as this is the only place where it does not pass a value through. the hdnStructure is a hidden filed
Oct 17 '08 #5

gits
Expert Mod 5K+
P: 5,235
could you search the page where you use this to check that your shown reference is correct? in the browser have a look at the source view, could you post that part of the html-page where this element is located?

kind regards
Oct 18 '08 #6

Post your reply

Sign in to post your reply or Sign up for a free account.