Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8221823
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T14:04:04+00:00 2026-06-07T14:04:04+00:00

In my forms I need a field to only display data. No editing will

  • 0

In my forms I need a field to only display data. No editing will be done on this data so I feel it’s not enough to set read_only on a text field. The idea is to create custom form field type that would accept different formats as the value (ex. DateTime, String).

The output would be somethink like

<div>
    <label>My Label</label>
    My value
</div>

I’ve been looking into the docs and also the code of the predefined field types but couldn’t make out how to go on 🙁

I’m not looking for the complete code, only need directions…

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T14:04:09+00:00Added an answer on June 7, 2026 at 2:04 pm

    Finally, thanks to another thread on Stackoverflow, I went with DataTransformer (see the Docs).

    This way I add the field as a text type and add a custom DataTransformer to the FormBuilder which will convert the data to the type I need.

    If anyone is interested in it I will post the code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to set the value of a field in a form via JavaScript.
I need to display two forms depending on the context. The second form should
I want to have display-only fields to render data that's never going to be
The short version of this question is: How can I take data that only
I need to identify a fraction from a form field in a recipe database
I have a form with phone number field, i need to validate it with
I am creating a JSF form where I have an email field. I need
I'm getting some troubles understanding how Symfony2 custom form field types work. I need
I need to validate submitted form data: To check whether fields are empty. Proceed
Do <input> elements in forms need to be a single word, either in totality

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.