Hello,

Thank you so much for your reply.

Im sorry, im quite new in this API.

//-----
function setRadioButton()
{
    var rad = document.getElementsByName('type');

    if ((getCheckedValue(rad) == '' && !farmSelected) || !
farmSelected)
    {
        rad[0].checked = true;
    }
    else
    {
        rad[0].disabled = true;
        rad[1].checked = true;
    }
}
//----

i have tried your method (setTimeout("alert('test');setRadioButton()",
1); )

It works. but as soon as i removed the alert (only call setRadioButton
method),
i got javascript error from this line from firefox:
rad[0].checked = true;   where the rad[0] is undefined,

But in IE, no error at all, however the radio button was't checked.
its like as thought the piece of code:
rad[0].checked = true; wasnt being executed.

Link to the updated page:
http://watermgttool.ncea.biz/pages/test1.aspx

Do you have any clue about this?

Thank you once again.

-Lidya


On Apr 16, 7:45 pm, Mike Williams <[email protected]> wrote:
> It appears to be a bug in Firefox. A <script> shouldn't be executed from
> the HTML of an openInfoWindowHtml call. The behaviour in MSIE, Chrome,
> Opera and Safari is correct. Firefox gets it wrong and executes the
> <script>.
>
> TRy doing it like this
>
> map.openInfoWindowHtml(point,"<br>Type: <input type='radio' name='type'
> onload='setRadioButton();' id='type' value='Farm'> Farm" +
>                                  "<input type='radio' name='type'
> id='type' value='Watering Station'>Watering Station" +
>                                  "<br> Watering Station: <input
> type='text' value='' id='WSname'/> <br> " +
>                                  "<input type='button'
> id='btnOKHTMLWindow' onclick=\"changeName(-1, " + poly.getArea() + ", '"
> + color + "');\" value='OK' /> <br> <br>");
>
> setTimeout("alert('test');setRadioButton()", 1);
>
> Don't worry about whether 1 millisecond is long enough, the timeout
> simply causes the alert() to get queued after the second part of the
> openInfoWindow, which the API causes to be queued with a timeout of zero
> milliseconds.
>
> ALSO: you'll need to do this
>         map.getInfoWindow().show();
> immediately after creating your map, to force the info window external
> module to be preloaded.
>
> --http://econym.org.uk/gmap
> The Blackpool Community Church Javascript Team
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to