Tuesday, August 23, 2022

Re: I want to fetch the value of radio field for updation but it only doesn't fetch even i use condition and value does comes but doesn't checked

On Mon, Aug 22, 2022 at 12:26:40PM +0530, Abhinandan K wrote:
> <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">

Do you need quotes around Male/Female like this?

{% if val_gen == 'Male' %}

--
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+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/20220823133115.GE7295%40fattuba.com.

No comments:

Post a Comment