GagakAngkasa
GagakAngkasa

Reputation: 39

Can't send data to another page

I want to send a hidden data and user input data to another page. First, I tried making only one user input, then the system could send the data as I wanted.

<h1><strong>Please scan barcode on JIG</strong></h1>
<table>
<form action="productjit21.php" method="post" name="check2"/>
<input type="hidden" name="productnumber" value="<?php echo $productnumber; ?>">
<tr><td>JIG Barcode</td><td>:</td><td><input type="text" name="jitcode2" maxlength="50"/></td></tr>
</table>

With above code, I can send the user and the hidden data. But, when I add a new line for user input, it can't send the data.

<h1><strong>Please scan barcode on JIG</strong></h1>
<table>
<form action="productjit21.php" method="post" name="check2"/>
<input type="hidden" name="productnumber" value="<?php echo $productnumber; ?>">
<tr><td>JIG Barcode</td><td>:</td><td><input type="text" name="jitcode1" maxlength="50"/></td></tr>
<tr><td>JIG Barcode</td><td>:</td><td><input type="text" name="jitcode2" maxlength="50"/></td></tr>
</table>

I do not create a submit button because we want to use bar code scanner. I don't think submit button is the problem because when I create only one user input, the system can run without a submit button.

Upvotes: 1

Views: 54

Answers (1)

Ruben
Ruben

Reputation: 659

Instead of closing the form tag immediately try to wrap the inputs in the form tags like so

<form action="productjit21.php" method="post" name="check2">
<input type="hidden" name="productnumber" value="<?php echo $productnumber; ?>">
<tr><td>JIG Barcode</td><td>:</td><td><input type="text" name="jitcode1" maxlength="50"/></td></tr>
<tr><td>JIG Barcode</td><td>:</td><td><input type="text" name="jitcode2" maxlength="50"/></td></tr>
</form>

Upvotes: 1

Related Questions