How to display multiple database values in a single input?

I have a small problem for a few hours. I'm working on an app that uses django python. (I'm new to Django)

I'm currently working on the Front-end, and I would like to display a first name and last name in an input. This works fine for two separate input but I would like to display the first name and last name in the same input.

I do not know how to do

<input style="background-color: blue;"{{form.user_first_name}}>

Thanks

try this

<input style="background-color:blue;" value="{{form.user_first_name.value}} {{form.user_last_name.value}}">

Refer the below links

https://docs.djangoproject.com/en/4.1/topics/forms/#looping-over-the-form-s-fields https://docs.djangoproject.com/en/4.1/topics/forms/

Back to Top