Everyone_Else Everyone_Else - 1 year ago 77
jQuery Question

How to not display URI variable on redirect?

I have the following form which is used to redirect the user to search a particular date.

<form action="/datesearch/" method="get" id="goto_date_form" style="display:none;">
<input name="dt" type="text" />
<input type="hidden" name="csrfmiddlewaretoken" value="[my csrf token value]">

When this form is called with
, it does redirect the page, but it displays both the value of dt and the value of csrfmiddlewaretoken as URI variables.

i.e. when searching for 2016-07-06 it redirects to

`http://localhost:8000/datesearch/?dt=2016-07-06&csrfmiddlewaretoken=[my csrf token value]`

How can I get it to stop displaying the csrf token?

Answer Source

Simply change method="get" to method="post" (and also back end too)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download