Tengo el siguiente Formulario
Código PHP:
//
<table width="660" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td bgcolor="#E4E9E9"><div align="center"></div></td>
<td bgcolor="#E4E9E9"><div align="center"><strong>Description</strong></div></td>
<td bgcolor="#E4E9E9"><div align="center"><strong>Date</strong></div></td>
<td bgcolor="#E4E9E9"><div align="center"><strong>Document Number </strong></div></td>
<td bgcolor="#E4E9E9"><div align="center"><strong>Comments</strong></div></td>
</tr>
<tr>
<td width="23" bgcolor="#E4E9E9"><label>
<input type="checkbox" name="op1" value="1" <?php if ($op1=="1") echo "checked onclick='this.checked=true;'";?>>
</label></td>
<td width="204" bgcolor="#E4E9E9">RFQ sent to the manufacturer</td>
<td width="97" bgcolor="#E4E9E9"><div align="center"><span class="style5"><? echo $fop1; ?></span></div></td>
<td width="224" bgcolor="#E4E9E9"><div align="center">
<input name="nrfqm" type="text" id="nrfqm" style="border:1 solid #000000 " value="<?=$nrfqm?>">
</div></td>
<td width="106" bgcolor="#E4E9E9"> </td>
</tr>
<tr>
<td bgcolor="#E4E9E9"><input name="op2" type="checkbox" onClick="MM_popupMsg('Please enter the number generated from QuickBooks (only for Quotations)) ')" value="1" <?php if ($op2=="1") echo "checked onclick='this.checked=true;'";?>></td>
<td bgcolor="#E4E9E9">Quotation sent to customer</td>
<td bgcolor="#E4E9E9"><div align="center"><span class="style5"><? echo $fop2; ?></span></div></td>
<td bgcolor="#E4E9E9"><div align="center">
<input name="nrequest" type="text" id="nrequest" style="border:1 solid #000000 " value="<?=$nrequest?>">
</div></td>
<td bgcolor="#E4E9E9"> </td>
</tr>
<tr>
<td bgcolor="#E4E9E9"><input name="op9" type="checkbox" id="op9" value="1" <?php if ($op9=="1") echo "checked onclick='this.checked=true;'";?>></td><td bgcolor="#E4E9E9">Quotation received for Customer</td>
<td bgcolor="#E4E9E9"><div align="center"><span class="style5"><? echo $fop9; ?></span></div></td>
<td bgcolor="#E4E9E9"><div align="center"></div></td>
<td bgcolor="#E4E9E9"> </td>
</tr>
<tr>
<td bgcolor="#E4E9E9"><input name="op10" type="checkbox" id="op10" value="1" <?php if ($op10=="1") echo "checked onclick='this.checked=true;'";?>></td>
<td bgcolor="#E4E9E9">Customer purchase received</td>
<td bgcolor="#E4E9E9"><div align="center"><span class="style5"><? echo $fop10; ?></span></div></td>
<td bgcolor="#E4E9E9"><div align="center"></div></td>
<td bgcolor="#E4E9E9"> </td>
</tr>
<tr>
<td bgcolor="#E4E9E9"><input name="op3" type="checkbox" id="op3" value="1" <?php if ($op3=="1") echo "checked onclick='this.checked=true;'";?>></td>
<td bgcolor="#E4E9E9">Sales Order sent to customer</td>
<td bgcolor="#E4E9E9"><div align="center"><span class="style5"><? echo $fop3; ?></span></div></td>
<td bgcolor="#E4E9E9"><div align="center">
<input name="sorder" type="text" id="sorder" style="border:1 solid #000000 " value="<?=$sorder?>">
</div></td>
<td bgcolor="#E4E9E9"> </td>
</tr>
<tr>
<td bgcolor="#E4E9E9"><input type="checkbox" name="op4" value="1" <?php if ($op4=="1") echo "checked onclick='this.checked=true;'";?>></td>
<td bgcolor="#E4E9E9">Payment Received </td>
<td bgcolor="#E4E9E9"><div align="center"><span class="style5"><? echo $fop4; ?></span></div></td>
<td bgcolor="#E4E9E9"><div align="center">
<input name="nfactura" type="text" id="nfactura" style="border:1 solid #000000 " value="<?=$nfactura?>">
</div></td>
<td bgcolor="#E4E9E9"> </td>
</tr>
<tr>
<td bgcolor="#E4E9E9"><input name="op5" type="checkbox" value="1" <?php if ($op5=="1") echo "checked onclick='this.checked=true;'";?>></td><td bgcolor="#E4E9E9">Purchase Order sent to Manufacturer</td>
<td bgcolor="#E4E9E9"><div align="center"><span class="style5"><? echo $fop5; ?></span></div></td>
<td bgcolor="#E4E9E9"><div align="center">
<input name="postc" type="text" id="postc" style="border:1 solid #000000 " value="<?=$postc?>">
</div></td>
<td bgcolor="#E4E9E9"> </td>
</tr>
<tr>
<td bgcolor="#E4E9E9"><input type="checkbox" name="op6" value="1" <?php if ($op6=="1") echo "checked onclick='this.checked=true;'";?>></td><td bgcolor="#E4E9E9">Product has been received</td>
<td bgcolor="#E4E9E9"><div align="center"><span class="style5"><? echo $fop6; ?></span></div></td>
<td bgcolor="#E4E9E9"><div align="center"></div></td>
<td bgcolor="#E4E9E9"> </td>
</tr>
<tr>
<td bgcolor="#E4E9E9"><input type="checkbox" name="op7" value="1" <?php if ($op7=="1") echo "checked onclick='this.checked=true;'";?>></td><td bgcolor="#E4E9E9">Product delivered to customer</td>
<td bgcolor="#E4E9E9"><div align="center"><span class="style5"><? echo $fop7; ?></span></div></td>
<td bgcolor="#E4E9E9"><div align="center">
<input name="pdtc" type="text" id="pdtc" style="border:1 solid #000000 " value="<?=$pdtc?>">
</div></td>
<td bgcolor="#E4E9E9"> </td>
</tr>
<tr>
<td bgcolor="#E4E9E9"><input type="checkbox" name="op8" value="1" <?php if ($op8=="1") echo "checked onclick='this.checked=true;'";?>></td><td bgcolor="#E4E9E9">Order has been closed</td>
<td bgcolor="#E4E9E9"><div align="center"><span class="style5"><? echo $fop8; ?></span></div></td>
<td bgcolor="#E4E9E9"><div align="center"></div></td>
<td bgcolor="#E4E9E9"> </td>
</tr>
</table>
Como pueden ver tengo checkbox los cuales son una serie de pasos a seguir ahora, cuando una persona selecciona un checkbox por ejemplo el primero, ajuro tiene que colocar los datos de un documento al lado en el cuadro de texto, es decir, la validacion seria:
Si esta seleccionado el Checkbox 1 y vacio el cuadro de texto y que salga un mensaje que diga DEBE COLOCAR EL NUMERO DE DOCUMENTO y haga un onFocus en el cuadro de texto..
Si alguien tiene un ejemplo se lo agradeceria
Gracias.