You'll need to use a RadioSelect widget. See example in the link as
follows:
https://docs.djangoproject.com/en/4.0/ref/forms/widgets/#django.forms.RadioSelect

On Mon, Aug 22, 2022 at 2:57 PM Abhinandan K <abhinan...@snakescript.com>
wrote:

> <label>Email</label>
> <input type="email" name="email" value={{datas.email}}>
> {% with val_gen=datas.gender%}
> {{val_gen}}
> <label>gender:</label><br></br>
>
> <input type="radio" name="gender" value="Male"{% if val_gen == Male %}
> checked{% endif %} >Male</input>
> <input type="radio" name="gender" value="Female"{% if val_gen == Female %}
> checked{% endif %}>Female</input><br><br>
> <input type="submit" value="Update">
> {% endwith %}
> </form>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAA6_Mp44RQjMeWfVW82vvT2-GLrv5Jpu2nb_6edWON_3sgXQwQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/django-users/CAA6_Mp44RQjMeWfVW82vvT2-GLrv5Jpu2nb_6edWON_3sgXQwQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>


-- 
Abdul Qoyyuum Bin Haji Abdul Kadir
HP No: +673 720 8043

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/CAA3DN%3DVe_NWF4kMxd18zW%3DOzND1YiYkvuyjmZgs5JxcX0UaQAQ%40mail.gmail.com.

Reply via email to