This is a migrated thread and some comments may be shown as answers.

RadMenu OnClientItemClicked on Firefox doesn't work

1 Answer 85 Views
Menu
This is a migrated thread and some comments may be shown as answers.
marco
Top achievements
Rank 2
marco asked on 04 Jan 2012, 02:16 PM
I'm experiencing the following issue on a very simple and basic code:
The radmenu OnClientItemClicked is not fired only on firefox (ver.7)
On all the other browser it's working as expected.

the RadMenu is empty and the items are added in code-behind:

RadMenuItem rmiItem = new RadMenuItem();
rmiItem .Text = "Menu Voice Text";
rmiItem .Value = "http://www.someurl.com";
//rmiItem .NavigateUrl = "#";
rmMainMenu.Items.Add(rmiItem );

and here is the radmenu in the aspx page:


<telerik:RadMenu ID="rmMainMenu" runat="server" Skin="Office2007" OnClientItemClicked="OnClientItemClicked" Width="100%">
<Items>
</Items>
</telerik:RadMenu>


once the user click over the menu item the following javascript is executed:

<script type="text/javascript">
    function OnClientItemClicked(sender, eventArgs) {
        var item = eventArgs.get_item();
        submitTo(item.get_value());
    }
 
    function submitTo(url) {
        form2.action = url;
        form2.submit();
    }
 
</script>

In IE7, IE8, Chrome and Safari, everything works as expected and the user is redirected to the page specified in the Value attribute of the RadMenu.
Only in Firefox, instead it does nothing, except that putting a # at the end of the URL (is not a postback)

Please note that this code is used to perform a POST submit of data to a different URL so, for this reason I haven't used the property NavigateURL.
In any case it works in the other browser so it's something wrong with RadMenu and Firefox.

Any help is appreciated.
Thanks
Marco

1 Answer, 1 is accepted

Sort by
0
marco
Top achievements
Rank 2
answered on 04 Jan 2012, 03:12 PM
SOLVED

and the error was on my side.
to access the form on FF I have to use
document.Forms["formname"].action = "....";

my fault and sorry to doubt about Telerik! 
Tags
Menu
Asked by
marco
Top achievements
Rank 2
Answers by
marco
Top achievements
Rank 2
Share this question
or