You need to sign in to do that
Don't have an account?
satakshi
javascript to check whether checkbox are checked or not
Hello,
I am writing a code where if checkbox is checked then mail will send to desired user otherwise it will show an error "Please select checkbox". Can i get javascript for this?
<apex:pageBlockTable value="{!searchResults}" var="accWrap" id="table"">
<apex:inputCheckbox onclick="selectAllCheckboxes(this,'inputId')"/>
<apex:inputCheckbox value="{!accWrap.selected}" id="inputId"/>
<apex:column colspan="5" value="{!accWrap.acc.Name}" />
<apex:column colspan="5" value="{!accWrap.acc.Email}" />
<apex:column colspan="5" value="{!accWrap.acc.Phone}" />
</apex:pageBlockTable>
I am writing a code where if checkbox is checked then mail will send to desired user otherwise it will show an error "Please select checkbox". Can i get javascript for this?
<apex:pageBlockTable value="{!searchResults}" var="accWrap" id="table"">
<apex:inputCheckbox onclick="selectAllCheckboxes(this,'inputId')"/>
<apex:inputCheckbox value="{!accWrap.selected}" id="inputId"/>
<apex:column colspan="5" value="{!accWrap.acc.Name}" />
<apex:column colspan="5" value="{!accWrap.acc.Email}" />
<apex:column colspan="5" value="{!accWrap.acc.Phone}" />
</apex:pageBlockTable>
jQuery code is easy for this.
Add onClick function in button.
Instaed of unsing onclick function in button, u can use .click() in jQuer it self as explained in below article.
http://www.minerva18.com/blog/using_jquery_in_salesforce_visualforce/