function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AM_SFDCAM_SFDC 

Lightning button issue

 ****This is my component details**** 
Attribute:
<aura:component >
    <aura:attribute name="ABC" type="string" default="false"/>

**This is lightning button details**
<lightning:button label="Submit" onclick="{!c.doSubmit}"></lightning:button>

**THis is my funtion doSubmit in controller**

({
    doSubmit : function(cmp, evt, hlpr) {
 //accessing the value in attribute ABC
        var initialABCValue = cmp.get("v.abc");
                if(initialABCValue == "true"){
                       alert("Value is true");
 //setting value of ABC to false
            cmp.set("v.abc","false");
        }
            else{
                     alert("Value is False");
 //setting value of ABC to true
            cmp.set("v.abc","true");
        }
    }
})

Now on click on button "Submit" on Page  i should get initially false value ,on next click it should be true value accordingly .As my function says so 

I am not getting changin vlaues on pop up just getting "False"
Can you helpmeguys with correction in code.[![enter image description here][1]][1]On click of button "Submit" pop value should change to false to true to false accordingly
Best Answer chosen by AM_SFDC
Hemant_SoniHemant_Soni
Hi,
This is very simple, As you know java script is case sensetive and as per java script you are using wrong veriable that's why this is always returning you false value. 
Simply Change your Vaiable Name in Component from ABC to abc do not modify your controller code ONLY AND ONLY Component Code.

Thanks

All Answers

Hemant_SoniHemant_Soni
Hi,
This is very simple, As you know java script is case sensetive and as per java script you are using wrong veriable that's why this is always returning you false value. 
Simply Change your Vaiable Name in Component from ABC to abc do not modify your controller code ONLY AND ONLY Component Code.

Thanks
This was selected as the best answer
AM_SFDCAM_SFDC
Thanks for quick reply ,I did changed  variable to small letters  and it worked .