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

SPELL CHECK not Working in Safari/Firefox

1 Answer 59 Views
Spell
This is a migrated thread and some comments may be shown as answers.
Zash
Top achievements
Rank 1
Zash asked on 21 Apr 2011, 07:20 PM
your example code works fine in i.e but does not work in non i.e like Safari 5.0, Firefox

The probelm is in the following function,  document.getElementById(buttonID) not being supported by Safari or Firefox browser

because document.getElementById(buttonID) does not return object.

What would be the work around for it in Safari?

 

 

 

function

SpellCheckClosed(sender, args) {

 

if

(IsChecked) {

 

 

 

//trigger submit from the update/insert button in the grid

 

 

 

//the id of the update or insert button is extracted from a hidden field

 

  

 

 

var buttonID = document.getElementById('<%=HiddenField1.ClientID %>'

).value;

 

  

document.getElementById(buttonID).click();  /// not being supported by non i.e like Safari and firefox

 IsChecked = 

false ;

 

 

  

}

 

}

Thanks

 

 

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 25 Apr 2011, 02:56 PM
Hi Zash,

This is a browser behavior. You can find information how to fix it in the following article: Fix for Firefox click() event issue as well as alternative for .click() method in firefox.
Copy Code
function SpellCheckClosed(sender, args)
{
    if (IsChecked)
    {
        //trigger submit from the update/insert button in the grid
        //the id of the update or insert button is extracted from a hidden field
        var buttonID = document.getElementById('<%=HiddenField1.ClientID %>').value;
        //document.getElementById(buttonID).click();
        if ($get(buttonID).dispatchEvent) {
            var e = document.createEvent("MouseEvents");
 
            e.initEvent("click", true, true);
            $get(buttonID).dispatchEvent(e);
 
        }
 
        else {
            $get(buttonID).click();
 
        }
        IsChecked = false;
    }
}


See also this Mozilla's article: https://developer.mozilla.org/en/DOM/element.click.

All the best,
Rumen
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Spell
Asked by
Zash
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or