Answers.Body: <p>Following my comment, you can edit the case start date component and change the widget to be a textfield. I was also able to disable the field on my webform.</p>
  
  <p>As you have a disabled text field, not sure what you mean by changing the date format. If it needs to be done in civi, you can navigate to <code>Administer -&gt; Customize Data and Screens -&gt; Date Formats</code>.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-28T13:27:19.997Z
Answers.Text: It seems to be picking up the date format from Drupal, not Civi. The date appears as 2018-08-25. I tried changing the short date format in Drupal to something a bit more readable, but this didn't affect the display in the webform.
Answers.UserDisplayName: Ben
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-31T23:38:27.190Z
Answers.Text: That is the storage format, e.g. the format used in the actual CiviCRM database. That's all you're going to get if you use a plain text field. You could however use javascript to make it look like whatever you want.
Answers.UserDisplayName: Coleman
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-28T12:15:37.830Z
Answers.LastActivityDate: 2018-08-28T12:15:37.830Z
Answers.UserDisplayName: jitendra - fuzion
Answers.Body: <p>It wasn't for the date field, but I've also had a scenario I need to display a field but not have it look editable. I ended up going the custom style route (the field itself was disabled but as you've noted did not look very clean.) </p>
  
  <p>With css you could you remove the border/select options (perhaps reduce padding) on those particular select fields so they no longer look editable but stay in the correct order.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-08-30T15:19:59.493Z
Answers.LastActivityDate: 2018-08-30T16:13:23.850Z
Answers.LastEditDate: 2018-08-30T16:13:23.850Z
Answers.UserDisplayName: RayWright
Body: <p>I am using a webform to edit cases in CiviCRM. I have a date field which I want to display, but keep disabled (the case start date). I want to replace the three select fields (day, month and year) with a single text field. </p>
  
  <p>The three select fields cannot be disabled and I do not want users to be able to change the date, but only to view it. It would also look a lot neater if it was just a single field. </p>
  
  <p>I tried the solution given <a href="https://www.codigovision.com/blog/drupal-7-change-webform-date-select-textfield-calendar-popup" rel="nofollow noreferrer">here</a>, which uses a template suggestion to overide the webform template, but this doesn't work for integrated CiviCRM (date) fields. </p>
  
  <p>The solution referred to above was to create a template called webform-calendar.tpl.php with the following code:</p>
  
  <pre><code>&lt;?php
   $idKey = str_replace('_', '-', $component['form_key']); 
  ?&gt;
  &lt;input type="text" id="edit-submitted-&lt;?php print $idKey ?&gt;" class="form-text &lt;?php print implode(' ', $calendar_classes); ?&gt;" alt="&lt;?php print t('Open popup calendar'); ?&gt;" title="&lt;?php print t('Open popup calendar'); ?&gt;" /&gt;
  </code></pre>
  
  <p>And also adding the following css:</p>
  
  <pre><code>.webform-container-inline.webform-datepicker  div.form-item.form-type-select {
      display: none;
  }
  </code></pre>
  
  <p>This would then get triggered for the webform date field. But this template does not get triggered for the CiviCRM date field.</p>
  
  <p>Can anyone suggest how I can either adpat this method or use a different way to replace the select fields with a single text field for the date, or at least disable the select fields?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-08-28T10:48:59.010Z
Comments.Text: can you not simply edit the case start date component and change the widget to be a textfield? I was also able to disable the field on my webform
Comments.UserDisplayName: jitendra - fuzion
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-08-28T11:57:22.133Z
Comments.Text: Do you know how I can change the format for the date? eg: 28th August 2018?
Comments.UserDisplayName: Ben
Tags: <webform-civicrm>
Title: Replace Webform Date Select Dropdowns with Textfield
ThreadText: # Replace Webform Date Select Dropdowns with Textfield
  
  (Asked by: username_0 on 2018-08-28)
  
  I am using a webform to edit cases in CiviCRM. I have a date field which I want to display, but keep disabled (the case start date). I want to replace the three select fields (day, month and year) with a single text field.
  
  The three select fields cannot be disabled and I do not want users to be able to change the date, but only to view it. It would also look a lot neater if it was just a single field.
  
  I tried the solution given [here](https://www.codigovision.com/blog/drupal-7-change-webform-date-select-textfield-calendar-popup), which uses a template suggestion to overide the webform template, but this doesn't work for integrated CiviCRM (date) fields.
  
  The solution referred to above was to create a template called webform-calendar.tpl.php with the following code:
  
  ```
  <?php
   $idKey = str_replace('_', '-', $component['form_key']); 
  ?>
  <input type="text" id="edit-submitted-<?php print $idKey ?>" class="form-text <?php print implode(' ', $calendar_classes); ?>" alt="<?php print t('Open popup calendar'); ?>" title="<?php print t('Open popup calendar'); ?>" />
  
  ```
  
  And also adding the following css:
  
  ```
  .webform-container-inline.webform-datepicker  div.form-item.form-type-select {
      display: none;
  }
  
  ```
  
  This would then get triggered for the webform date field. But this template does not get triggered for the CiviCRM date field.
  
  Can anyone suggest how I can either adpat this method or use a different way to replace the select fields with a single text field for the date, or at least disable the select fields?
  
  **Tags:** webform-civicrm
  
  > **Comments:**
  > **username_1**: can you not simply edit the case start date component and change the widget to be a textfield? I was also able to disable the field on my webform  
  > **username_0**: Do you know how I can change the format for the date? eg: 28th August 2018?  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2018-08-28. Score: 2 | Accepted answer
  
  Following my comment, you can edit the case start date component and change the widget to be a textfield. I was also able to disable the field on my webform.
  
  As you have a disabled text field, not sure what you mean by changing the date format. If it needs to be done in civi, you can navigate to `Administer -> Customize Data and Screens -> Date Formats`.
  
  > **Comments:**
  > **username_0**: It seems to be picking up the date format from Drupal, not Civi. The date appears as 2018-08-25. I tried changing the short date format in Drupal to something a bit more readable, but this didn't affect the display in the webform.  
  > **username_2**: That is the storage format, e.g. the format used in the actual CiviCRM database. That's all you're going to get if you use a plain text field. You could however use javascript to make it look like whatever you want.  
  
  ---
  
  ### Answer by username_3 on 2018-08-30. Score: 0
  
  It wasn't for the date field, but I've also had a scenario I need to display a field but not have it look editable. I ended up going the custom style route (the field itself was disabled but as you've noted did not look very clean.)
  
  With css you could you remove the border/select options (perhaps reduce padding) on those particular select fields so they no longer look editable but stay in the correct order.
  
  
  ---
  
  