user3313439
user3313439

Reputation:

HTML form: how to submit a value without showing it in the form?

I have an HTML form that sends a food dish. For example,

placeorder.com/order.php?id=STEAK

I want to add another value and send

placeorder.com/order.php?category=MEAT&id=STEAK

But, I don't want the user to have to select meat anywhere, since this has been already decided.

I tried to tinker with the form target and include it from there, but it didn't work.

Is there some "hidden text box" to write the category to so that it gets posted, or is there another way to do it?

Thanks in advance!

Upvotes: 0

Views: 2410

Answers (1)

Anonymous
Anonymous

Reputation: 12027

First, I just thought I'd mention that it's funny how the questions is phrased since you pretty much answered your own question:

Is there some "hidden text box"

Anyway, yes:

You can use type='hidden'

I assume that you are already using a GET form so I will just include the input part:

<input name='category' type='hidden' value='MEAT'>

Upvotes: 3

Related Questions