HtmlViewer output to webtextfield

Hi everybody

I have this code in the opening event of the HtmlViewer that display latitude e longitued when event fire.


var latlong as String

latlong=("<html>"+_
"<body>"+_
"<p id='demo'></p>"+_
"<script>"+_
"if (navigator.geolocation) {"+_
"navigator.geolocation.getCurrentPosition(showPosition);"+_
"} else {"+_
"document.getElementById('demo').innerHTML ="+_
"'Geolocation is not supported by this browser.';"+_
"}"+_
"function showPosition(position) {"+_
"document.getElementById('demo').innerHTML ="+_
"'Latitude: ' + position.coords.latitude + '<br>' +"+_
"'Longitude: ' + position.coords.longitude;"+_
"}"+_
"</script>"+_
"</body>"+_
"</html>")

Var output As String
output = latlong

HTMLViewer1.LoadHTML(output)
HTMLFile = New WebFile
HTMLFile.Data = output
HTMLFile.MIMEType = "text/html"
HTMLViewer1.LoadURL(HTMLFile.URL)

Now i need to pass it values to a webtextfield, but i did not find a solution on how to do that.

do you have any suggestions?

Thanks for the help

Sandra