I have an issue with custom action.
Here is the definition of my custom action:
<CustomAction
Id="GoToDefi"
Title="Go To"
Description="Go To"
RequireSiteAdministrator="FALSE"
RegistrationType="ContentType"
RegistrationId="0x01"
GroupId="ActionsMenu"
Location="DisplayFormToolbar"
Sequence="1000">
<UrlAction Url="javascript:GoToFunction();"/>
</CustomAction>
So basically this is bound to CT and in display item form when i click on it, it doesnt redirect to anywhere, it just refereshes and that is it.
Here is the function code:
function GoToFunction()
{
//Some extra steps are done
window.location.href = "www.google.com";
}
Any idea what am i missing?
UPDATE:
I noticed a bit strange behaviour, when i hover over my link, i see that it has javascript:_dopstostback(...); But not my script.
When i do the debugging, my script is wel being called, but i think this _doPostBack overwrites my changes. I checkthed the html and i see following:
....
<tr>
<td class="ms-toolbar" nowrap="nowrap" >
<a id="....toolbartbl_rpControls_ct112" href="javascript:_doPostBack('ct1000....','')"/>
<a id="....toolbartbl_rptControls_CT112_LinkText" href="javascript:myfunction();" />
</td>
I don't know why but there are 2 anchor elemenets, and i think that postback is breaking my redirection.
But if in my custom action i give url like that url='www.google.com' then both of elements have href to www.google.com. But if i use any kind of javascript then it is not working anymore.

