+ Start a Discussion
jd123jd123 

How can i do this?

Hi 

 

I have one object Shedule have Monday_Start_Time and Monday_End_Time like up to Sunday_Start_Time and Sunday_End_Time so total 14 fields. I would like to display like this.

 

 

  Day                  Start Time                       Endtime

 

 Monday              6:00 AM                        6:00 PM                    Clear button

 Tu esday            ---                                  -----                            Clear button

 wenesday          -------                             -----                            ----------

  ------

  ----

                                                                                                       -------------

Sunday                ---                                      --------                    Clear Button

 

  

Clear All  button:

 

 

when i am clicking Clear All button all fields should null. If i am clicking on particuler Clear button that row values(may Monday start time and End time) should null.

 

Any help is greatly Appricated.

 

 

AquilaDeveloperAquilaDeveloper

Need to work more on ClearAllData js .... 

See how much it can be helpful to you ...

 

<apex:page standardcontroller="Schedule__c">
<script>
function clearData(txtid1,txtid2){
document.getElementById(txtid1).style.display ='none';
document.getElementById(txtid2).style.display ='none';
}

function clearAllData(txtid1,txtid2,txtid3,txtid4){
document.getElementById(txtid1).style.display ='none';
document.getElementById(txtid2).style.display ='none';
document.getElementById(txtid3).style.display ='none';
document.getElementById(txtid4).style.display ='none';
}
</script>
<apex:form >
<apex:pageBlock title="Schedule">
<apex:pageBlockSection columns="4" title="Schedule" >
<apex:pageBlockSectionItem >Day</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >Start Time</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem >End Time</apex:pageBlockSectionItem>
<apex:pageBlockSectionItem ></apex:pageBlockSectionItem>

<apex:pageBlockSectionItem >Monday</apex:pageBlockSectionItem>
<apex:outputPanel id="startTime1">
{!Schedule__c.Monday_start_time__c}
</apex:outputPanel>
<apex:outputPanel id="endTime1">
{!Schedule__c.Monday_end_time__c}
</apex:outputPanel>
<input type="button" value="Clear" onclick="clearData('{!$Component.startTime1}','{!$Component.endTime1}');"/>

<apex:pageBlockSectionItem >Tuesday</apex:pageBlockSectionItem>
<apex:outputPanel id="startTime2">
{!Schedule__c.Monday_start_time__c}
</apex:outputPanel>
<apex:outputPanel id="endTime2">
{!Schedule__c.Monday_end_time__c}
</apex:outputPanel>
<input type="button" value="Clear" onclick="clearData('{!$Component.startTime2}','{!$Component.endTime2}');"/>

<input type="button" value="Clear All" onclick="clearAllData('{!$Component.startTime1}','{!$Component.endTime1}','{!$Component.startTime2}','{!$Component.endTime2}');"/>
</apex:pageBlockSection>
</apex:pageBlock>

</apex:form>
</apex:page>