i want to get a value in an input to a django views, this is not a form as i am not trying to submit any form, i just need the value that is in the input field
this is the html template
<input readonly name="ref_code" type="text" value="{{ request.user.profile.recommended_by.profile.code }}">
this is my django views
code = str(request.GET.get('ref_code'))
print("This is the code:" + code)
It keep printing This is the code: None
NOTE: i have also tried using request.POST.get("ref_code") it did not still work
What might be the issue?
i want to get a value in an input to a django views, this is not a form as i am not trying to submit any formThere are two ways to get the value in a form: 1) Have the form be submitted to Django. 2) Have JavaScript read the value and send it to Django. There's no other way to get it.