从表单中获取特定信息

Is there a way to get only a certain set of information from a form? Eg

<form>
<input name='I want this' value='one' type=text />
<input name='and this' value='one' type=text />
<input name='but not this' value='one' type=text />
</form>

Where, obviously, i only want the first two fields but not the third one? I've got a user inventory on my website that looks like this:

 <form action="" method="POST">
<input name='item_id' value='1' type='hidden'>
<input type='button' name='slot1' value='1'>
<input type='button' name='slot2' value='2'>
<input name='item_id' value='2' type='hidden'>
<input type='button' name='slot1' value='1'>
<input type='button' name='slot2' value='2'>
</form>

I want the users to be able to select, item 1 and equip it to slot 1 but The only way i can think of doing this right now is to have them all be separate forms. and i feel like that would be bad coding.

Yes, using jquery, select only the first element and second elements value, post it using ajax, and retrieve and process data server side.

var i1 = $('form').eq(0).find('[name="item_id"]').val()  //Values from first form only
var i2 = $('form').eq(0).find('[name="slot1"]').val()

$.ajax({
  url: "test.php",
  data: {i1:i1, i2:i2}, //Send this to php file.
  }).done(function() {
  $(this).addClass("done");
  });

When you submit a form the values of all inputs associated with that form will be added to the $_POST (array) variable. You can always choose to ignore values when certain conditions apply. If that's not an option, I think you should opt for separate forms.

Another thing you could do—I do not understand the context of your problem, so I'm not sure if it applies to your situation—is have a user choose between "Item 1" and "Item 2" via radio buttons in your form. You can then base your form handling logic on the choice people made in the form.