You need to sign in to do that
Don't have an account?
Girish Reddy 52
onclick button not working, I'm not sire what is the problem. Please check the below code.
Aura Component
<aura:component >
<lightning:card title="Emp Details">
<lightning:button label="Submit" onClick="{!c.Submit}"/>
</lightning:card>
</aura:component>
Controller
({
Submit : function(component, event, helper) {
alert('Show Alert');
}
})
when I click on submit button it's not working at all, I tried writing another sample code but faced the same issue. Please help
<aura:component >
<lightning:card title="Emp Details">
<lightning:button label="Submit" onClick="{!c.Submit}"/>
</lightning:card>
</aura:component>
Controller
({
Submit : function(component, event, helper) {
alert('Show Alert');
}
})
when I click on submit button it's not working at all, I tried writing another sample code but faced the same issue. Please help
I tried with the below code and it is working as expected.
Component:
Controller:
If this solution helps, Please mark it as best answer.
Thanks,
All Answers
I tried with the below code and it is working as expected.
Component:
Controller:
If this solution helps, Please mark it as best answer.
Thanks,
I still did not get it, What was the mistake in my code can you please say me. Also I tried your code it is also not working for me
How did you test this. Did you add this component as a tab?
Thanks
While being on a component tab I clicked on the controller and from there adding the onclick function.
Thank you Sai Praveen for your help