0

I have a form that I am doing a METHOD="GET" on, so I want the form to make a HTTP request with the form fields as querystring values.

I have some hidden form fields, and when I click a button I wanted the form to be posted to:

/some/path?a=1&b=2

But because the form fields were hidden they don't get included.

I then changed the input type to text, but did a display:none on each one, and the same thing happens.

If I change the action URL to include querystring values, those also get ignored.

How can I get this too work? I want clicking a button to include the querystring values in the form http GET request.

cool breeze
  • 4,461
  • 5
  • 38
  • 67
  • This is a known topic Duplicate : https://stackoverflow.com/questions/1374147/how-to-avoid-sending-input-fields-which-are-hidden-by-displaynone-to-a-server –  Oct 26 '17 at 22:02
  • 1
    Do the hidden fields have a name attribute on them? They must have a name attribute on them to be included in the normal form submit logic. – Taplar Oct 26 '17 at 22:03
  • @headmax that thread is about inputs being sent and wanting to ignore them. This thread is about them not being sent and wanting to include them. It's the reverse case. – Taplar Oct 26 '17 at 22:04
  • @Taplar ok didn't really show :(, why this inputs is named as hidden ... –  Oct 26 '17 at 22:07

0 Answers0