i am working on project in which i have to used python to make blind person to access their account so when they speak there name i want to display it on input field in forms using djangomy view for register
And beolow is my html code in which i have used ajax to make post request to server
<form action="" method="post" > <div class="form-group" align="center"> <input type="text" name="Email" class="form-control" value="{{ email }}" readonly placeholder="Email Id" id="myNumber" > </div> </br> <a type="submit" class="btn btn-success btn-lg rounded-pill" href='{% url 'menu' %}' >Submit</a> </form> </div>
but when i run it work fine but it doesnt display anything on the input field it take input and save it in email variable if print it shows it but not displaying in input field plz answer
Advertisement
Answer
You are assigning value to context dictionary on POST method so in GET method the dictionary is empty so you are sending None in your register view function to the input page. You should take care of the GET method and fill the values according to it.