I have a textfield with a submit button as follows:
<form id="keywordForm" action="r2/keyword_subscribe/" method="post">
<input type="text" size="50" value="Enter a new keyword for rosebud to crawl!">
</br>
<input type="submit" value="Submit" onclick="send()" />
Question is i want to retrieve the value of the text in that textfield in my views.py. Is there any way i can do that?
I have a jquery script on the top with the submit button.
$("#keywordForm").submit(function(){};
I need to know how to pass it in.
Thanks guys!
To get it with javascript:
And then:
Now you have the value in that “value” variable.
Because you did not have the “name” attribute in the field it wasn’t submitted to the server. If you add it, that input will be sent to the server and you can get it in php like this: