I had to do it this way:
1- Add hidden inputs inside the file that contains the iframe where they save the lng and lat whenever the user changes them.
2- Create this function on js:
function getFrameWindow(frameId) {
var frame = document.getElementById(frameId);
var result = null;
if (frame.contentDocument) {
// For NS6
result = frame.contentDocument.window || frame.contentDocument.defaultView;
} else if (frame.contentWindow) {
// For IE5.5 and IE6
result = frame.contentWindow;
} else if (frame.document) {
// For IE5
result = frame.document.window;
}
return result;
}
3- used this code from the javascript that contains the iframe:
getFrameWindow("iframe").document.getElementById("lat").value