+ Start a Discussion
Mary Pamishetty 3Mary Pamishetty 3 

attributes in <apex:commandbutton >

I want to use disabled and html-data-toggle attributes in commandcommand, ​first i want to show error messages if no errors show modal popup

Following is not working.How can i achieve this?
<apex:commandbutton    value="Save"  rerender="frmLead" status="status" disabled="{!hasError==true}"   html-data-toggle="modal" html-data-target="#userEConsent"  ></apex:commandbutton>
Shweta_AgarwalShweta_Agarwal
Hi Mary,

Try using Html button tag in place of <apex:commandbutton >. Change below code according to your requirment.
 
<button type="button" class="btn btn-info" data-toggle="modal" data-target="#userEConsent" disabled="{!IF(hasError==true,'disabled','')}">
  Save
</button>
Hope this help you.

Thanks
Shweta
 
Mary Pamishetty 3Mary Pamishetty 3
Thanks Shweta. I have to use apex commandbutton.