Solved

opener.document.form value problem

Posted on 2009-07-07
2
339 Views
Last Modified: 2012-05-07
I have the following code to post the updated data from my pop-up window back to the parent. However, since I have multiple updated data records to change, I need to create each field unique. So I did the following code: However, the code errors out as the hyphen in the form field name isn't liked. How can I be sure it accepts my naming convention?
<script langauge="javascript">
function post_value(){
opener.document.frm.245032-latitude.value = document.form1.lat.value;
opener.document.frm.245032-longitude.value = document.form1.lon.value;
opener.document.frm.245032-matchlevel.value = document.form1.LevelCode.value;
self.close();
}
</script>

Open in new window

0
Comment
Question by:jfergy
2 Comments
 
LVL 7

Accepted Solution

by:
alexpercsi earned 125 total points
ID: 24797245
Make sure those IDs are specified in the ID attribute not the Name attribute of the tags (e.g. <input type="text" id="245032-latitude" />)

If this condition is met, you can change your code to:
<script langauge="javascript">
function post_value(){
opener.document.getElementById("245032-latitude").value = document.form1.lat.value;
opener.document.getElementById("245032-longitude").value = document.form1.lon.value;
opener.document.getElementById("245032-matchlevel").value = document.form1.LevelCode.value;
self.close();
}
</script>

Open in new window

0
 

Author Closing Comment

by:jfergy
ID: 31600744
Terrific, Thanks!
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Decoding Special HTML Characters using Javascript? 2 29
how can i make the array into an object? 4 32
Jquery 10 20
Call a function within the ASP code 4 12
Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question