Django - How To Do An If Statement If Button Is Clicked April 17, 2024 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 viewsif request.GET.get('Next') == 'Next': print('user clicked summary') CopyBecause the name of the button is 'Next' not 'Name' Baca JugaDjango Loading Static Files?Displaying Validation Error Instead Of Default Text Errors In Django UsercreationformOverride Images From Getting Height+width From Css, Html Attribute Instead Share You may like these postsRender_to_string And Response.content.decode() Not MatchingBootstrap Files 404 DjangoDatetimeinput Is Being Rendered As Simple Text Input In DjangoPutting Submit Button At The Bottom Of The Form 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"