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
IntroAmmyIntroAmmy 

Need to add hidden field with Default value

I need to add lightning input hidden field with default value "DSP"
When i will save my form with other fields which is in web form this default value will insert in obeject.

<aura:attribute name="dsp" type="String" default="DSP"/>
<lightning:input name="dsp form" value="{!v.leadObj.BIIB_DSP_Form__c}" label="Form"  class="slds-hide"/>

Contrller .js

    doInit: function(cmp) { 
   component.set("v.leadObj.BIIB_DSP_Form__c" ,"DSP");
        var pickvar = cmp.get("c.getPickListValuesIntoList");
        pickvar.setCallback(this, function(response) {
            var state = response.getState();
            if(state === 'SUCCESS'){
                var list = response.getReturnValue();
                cmp.set("v.picvalue", list);
            }
            else if(state === 'ERROR'){
                //var list = response.getReturnValue();
                //component.set("v.picvalue", list);
                alert('ERROR OCCURED.');
            }
        })
        $A.enqueueAction(pickvar);
        
   },

Can someont help me where i am doing wrong
Suraj Tripathi 47Suraj Tripathi 47
Hi,

I found a similar type of query as you have. please go through the below link.

-https://developer.salesforce.com/forums/?id=9060G0000005iekQAA
-https://salesforce.stackexchange.com/questions/204745/how-to-create-a-hidden-input-field-in-a-lightning-component

Please mark it as Best Answer if it helps you.

Thanks & Regards
Suraj Tripathi