+ Start a Discussion

OnChange event using Javascript

I have 2 input fields in my visualforce page Logic__c(Data Type-Picklist) with values Text1 and Date2. and one more field Type__c(Text Data Type).
When I select Text1 in Logic__c dropdown  TEXT box should display for Type__c field. When I select  Date2 in Logic__c dropdown Date Picker should display for Type__c field. 
I am trying for onchange event using javascript. Please guide me in this.