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

<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> <br>


<input type="radio" name="gender" value="Female" {% if val_gen == "Female" %} checked{% endif %}>Female</input> <br><br>


<input type="submit" value="Update">


{% endwith %}


</form>


On 22 Aug 2022 08:57, "Abhinandan K" <abhinandan@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+unsubscribe@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.

--
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/CAHs1H7t75MThqaGW7GZkbbPWOv0-%2BMUgq1VWFBGRgRAmiVYoww%40mail.gmail.com.

No comments:

Post a Comment