How to hide nodes related to id input

1 Answer 55 Views
Form
kva
Top achievements
Rank 2
Iron
Iron
Iron
kva asked on 09 Aug 2023, 08:07 AM

When I add input for Id as said here https://docs.telerik.com/aspnet-core/html-helpers/layout/form/hidden-fields

i.Add().Field(f => f.Id).Editor(e => e.Hidden());

I got this text on my

Id:
hidden

How to get rid of it?

Also, I don't see input in the DOM tree, how Id will be transferred to the server?

1 Answer, 1 is accepted

Sort by
2
Accepted
Mihaela
Telerik team
answered on 11 Aug 2023, 06:08 PM

Hello,

I have tested the Hidden() option, and it appears that the overall input is hidden as expected at my end. For your convenience, I am sharing a REPL sample:

https://netcorerepl.telerik.com/mHOCFbFC0498Xc3u18

Would you please share the Form configuration at your end and any related CSS styles?

Generally, when a specified Form item is hidden, its wrapper (<div> element with class "k-form-field") receives a class "k-hidden" and the input itself is not removed from the DOM tree:

Regarding the form submission, the hidden fields are submitted to the server along with the visible fields.

 

Regards, Mihaela Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages. If you're new to the Telerik family, be sure to check out our getting started resources, as well as the only REPL playground for creating, saving, running, and sharing server-side code.
kva
Top achievements
Rank 2
Iron
Iron
Iron
commented on 14 Aug 2023, 05:06 AM | edited

Indeed. I think that was the version problem described here https://www.telerik.com/forums/checkboxfor-throws-exception.
Mihaela
Telerik team
commented on 15 Aug 2023, 01:59 PM

Thank you for confirming that the issue has been resolved at your end.
Tags
Form
Asked by
kva
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Mihaela
Telerik team
Share this question
or