Ask coding questions

← Back to all posts
Flask Argument and Form Input.
TheSummit3145 (22)

HIIIIIII

I want to take the id argument from the link and then take form input and then return both the id and the form input. The following program doesn't work. Whats wrong

Commentshotnewtop
PattanAhmed (1103)

@TheSummit3145 Hi,
Check this amazing website:-
I think that might help you...
Click here
Thanks!

Hope this helps

Coder100 (8744)

what is not working?

TheSummit3145 (22)

@Coder100 it doesnt return the id just the form input :(

Coder100 (8744)

well now your repl is down @TheSummit3145

Coder100 (8744)

@TheSummit3145 Basically you aren't setting the paramter, you have to add ?id=something to your url.

TheSummit3145 (22)

@Coder100 it no work:(

if i go to https://pinksiennaquadrilateral.thesummit3145.repl.co/formargtest?id=123 and then type bob as the input, i want it to say
id: 123 contents: bob
but it doesnt say anything for the id

TheSummit3145 (22)

@Coder100 is there any way to not get it deleted? that was the original question

TheSummit3145 (22)

can you gimme an example @Coder100

TheSummit3145 (22)

@Coder100 didn't I do that?
i did

<form action="{{ url_for("hello")}}" method="post"> <label for="form">form:</label> <input type="text" id="formy" name="formy" placeholder="stufs">
Coder100 (8744)

got it, your function is now:

<form action="[your current path here]">
  ...
</form>

@TheSummit3145

TheSummit3145 (22)

@CodingCactus im not trying to do login tho. i just want to get an argument form the url and a form input and then return both of them

CodingCactus (3039)

@TheSummit3145 well yes but it still shows how to get the input from the form