0

i'm trying to get the input value on button click

if request.method == 'POST':
   if request.POST['fah']:

this is getting me False when page is loaded and if i click on button, it's not changing

how can i write something like js addEventListener in django?

my button

<button type="button" class="bbtn" name="fah" id="fah" value="fah">Convert</button>

1 Answer 1

0

The value of a button is not submitted if the button does not have role submit. You can include a hidden field that contains your value or pass the value as a URL query string.

Sign up to request clarification or add additional context in comments.

1 Comment

Take a look at this solution stackoverflow.com/questions/69755179/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.