0

hello guys i am up to a task. i want to add a functionality to my form that when the city in given in the address field it can be viewed in google map application.For this i had found design a image so that when location is specified in the city field..that image hyper link can click if the person want to see the city location in the map.i found a code related to this in vb scrpit.Can some help me out that how could i write it in javascript.

Function OpenMap(Address, City, State, Zip, Country)

    Dim strAddress As String
    strAddress = Nz(Address)
    strAddress = strAddress & IIf(strAddress = "", "", ", ") & Nz(City)
    strAddress = strAddress & IIf(strAddress = "", "", ", ") & Nz(State)
    strAddress = strAddress & IIf(strAddress = "", "", ", ") & Nz(Zip)
    strAddress = strAddress & IIf(strAddress = "", "", ", ") & Nz(Country)
    
    If strAddress = "" Then
        MsgBox "There is no address to map."
    Else
        Application.FollowHyperlink "http://maps.live.com/default.aspx?where1=" & strAddress
    End If
End Function

i have another question that can we use Application.FollowHyperlink in javascript.

Edited by extemer: n/a

1
Contributor
1
Reply
2
Views
6 Years
Discussion Span
Last Post by extemer
0

i come up this code in javascript.i known this not write but can any body correct it

<script language="javascript">
   function OpenMap(Address, City, State, Zip, Country)

    Dim var strAddress As String
    strAddress = Nz(Address)
    strAddress = strAddress & if(strAddress = "", "", ", ") & Nz(file)
    strAddress = strAddress & if(strAddress = "", "", ", ") & Nz(State)
    strAddress = strAddress & if(strAddress = "", "", ", ") & Nz(Zip)
    strAddress = strAddress & if(strAddress = "", "", ", ") & Nz(Country)
    
    If(strAddress=="") 
	{
        document.write("There is no address to map.");
	}
	else
       <a href="http://maps.live.com/default.aspx">click me</a>;
    }



</script>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.