Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

opener.document.form value problem

Posted on 2009-07-07
2
Medium Priority
?
358 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 7

Accepted Solution

by:
alexpercsi earned 500 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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…

715 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