Django - How To Do An If Statement If Button Is Clicked August 23, 2022 Post a Comment I want the user to click a button on my website, and when it is clicked I want i = i + 1. So far I have this code that doesn't work # On html file Solution 1: Try - # On html file <form method='get' action='#'> <input type="submit" value="Next" name="Next"/> </form> # In django views if request.GET.get('Next') == 'Next': print('user clicked summary') Copy Because the name of the button is 'Next' not 'Name' Baca JugaHow To Add My Own Files To Django 'static' FolderPassing Information Between Web Pages In DjangoPandas Read_html Clean Up Before Or After Read Share You may like these posts Django Send Authenticated User To Another Django Server With The Same DbWhy Isn't Django Returning A Datetime Field From The Database?Django - (1366, "incorrect String Value:... ErrorDjango Sharing One Model Between Two Others Post a Comment for "Django - How To Do An If Statement If Button Is Clicked"
Post a Comment for "Django - How To Do An If Statement If Button Is Clicked"