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
raj123raj123 

How to remove default date value from the input while inputing the date field

i am not able to remove, the default value , actually i am doing the following

 

apex:pageblocksectionItem id="pgsecItm2">
                <apex:outputLabel value="To:" /><apex:inputField value="{!EndRange.Date}" id="dateorg2" onchange="populateHiddenFields()"/>
            </apex:pageblocksectionItem>

 

<script>

function populateHiddenFields()
        {
            document.getElementById('{!$Component.pg:frm:pgBlk:dateHdn}').value=document.getElementById('{!$Component.pg:frm:pgBlk:pgsec:pgsecIt:dateorg}').value; ( if i do.value='' ; the value is not getting populated.)
           
        }

<script>

 

 <apex:inputHidden id="dateHdn" value="{!strStartShipDate}"/>

 

can some one  please help me with this

bob_buzzardbob_buzzard

Your component reference doesn't look quite right to me.

 

$Component.pg:frm:pgBlk:dateHdn

 

the $Component uses dotted notation, so the elements would be separated by '.' rather than ':'

raj123raj123

No change bob i replaced ':' with '.' , still the input field is showing default value, i want htis as blank,  there is no default value on the field i checked that too.

bob_buzzardbob_buzzard

If you view the source of the page, what does the $Component... turn into when the page is rendered.