Results 1 to 2 of 2

Thread: javascript question

  1. #1
    Join Date
    Jul 2005
    Location
    Planet Earth
    Posts
    94
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default javascript question

    ok, heres my problem...

    basically I have a variable and it stores a html form, you don't need to understand what the function does, but here it is

    GEvent.addListener(map, 'click', function(overlay, point) {

    map.addOverlay(new GMarker(point));
    var html = "<form action='formp.php' method='post'>Add Information for this spot<br /><input type='text' name='text' /><br /><input type='hidden' name='point' value='' /> <input type='submit' name='submit'/></form>";
    var marker = createMarker(point, html);
    map.addOverlay(marker);
    });

    now my problem

    In the html form, I need to include a hidden field with the value from the variable point (GEvent.addListener(map, 'click', function(overlay, POINT) { )

    how can i mix text with another variable, in php I would use a . to concatenate two bits of info together like so:

    var html "<html>" . point . "</html>";

    how can you do that in javascript

    _____________

    redice

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Code:
    var html = "<html>" + point + "</html>";
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •