You need to sign in to do that
Don't have an account?

Checkbox click to redirect to account page
Hi All,
Could you please help me in achieveing the following.
1. VF page has all account name with checkbox.
2. On checkbox click on VF page it should redirect to the account page detail of that record.
Regards.
<apex:page standardController="Account" recordSetVar="accounts" tabStyle="Opportunity" sidebar="false" >
<script>
function hello()
{
var x = document.getElementById('cd').checked;
if (x == "")
{
alert("Please select");
return false;
}
window.open('https://c.ap1.visual.force.com/apex/standardcontroller?id={!Account.id}');
}
</script>
<apex:form >
<apex:pageBlock mode="edit">
<apex:pageMessages />
<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!save}"/>
<apex:commandButton action="{!edit}" value="Edit"/>
<apex:commandButton action="{!delete}" value="Delete"/>
<apex:commandButton value="Cancel" action="{!cancel}"/>
<apex:commandButton value="Quick Save" action="{!quicksave}"/>
<apex:commandButton value="List" action="{!list}"/>
<apex:commandButton value="check deatil" onclick="hello()"/>
</apex:pageBlockButtons>
<apex:pageBlockTable value="{!accounts}" var="a">
<apex:column headerValue="Name">
<apex:outputLink value="/{!a.Id}" target="_blank">{!a.Name}</apex:outputLink>
</apex:column>
<apex:column headerValue="CheckBox Action" >
<apex:inputCheckbox value="{!a.name}" style="position:absolute;left:900px;" id="cd" >{!a.Name}</apex:inputCheckbox>
</apex:column>
</apex:pageBlockTable>
<apex:pageBlockSection title="Selected Account" id="sa" collapsible="true">
<apex:DataTable value="{!accounts}" var="s" columnswidth="50px,50px" cellpadding="4" border="1">
<apex:column headervalue="Account Name" value="{!s.Name}" />
<apex:column headervalue="Account Number" value="{!s.AccountNumber}" />
<apex:column headervalue="Phone" value="{!s.Phone}" />
</apex:DataTable>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
Try this