Ver Mensaje Individual
  #1 (permalink)  
Antiguo 18/12/2008, 09:36
Avatar de wrafaelp
wrafaelp
 
Fecha de Ingreso: marzo-2008
Ubicación: Cercado de lima
Mensajes: 26
Antigüedad: 16 años, 10 meses
Puntos: 0
AYuda en Validacion y envio de datos

bueno, los q kiero es validar un grupo de text, checkbox q son generados
Código HTML:
{include_php file='libs/header.php'} 
<script language="javascript">
{literal}
function GenerarOS(opc){
	var frm=window.document.frmIdentidad;
	if(frm.cod_estado_requerimiento[frm.cod_estado_requerimiento.selectedIndex].value != 7){alert("Valido Solo Para Generar Orden de Salida");frm.cod_estado_requerimiento.focus();return;}
	
	if(frm.ca4.value==""){alert("Cantidad No Valida");frm.ca4.focus();return;}
	if(frm.ca4.value > frm.st4.value){alert("La Cantidad No Debe ser Mayor al Stock");frm.ca4.focus();return;}
	//aca esta validando para un determinaod items peero el problema era cuando genero varios
	//if(frm.ca4.value==0){alert("La canitdad Debe Ser Al Menos 1");frm.ca4.focus();return;}
	//if(cb4.checked==true){alert("Seleccione un items");return;}
	
	
	
	if(confirm("Desea Realmente Generar Orden de Salida")){ 
		frm.hdnAccion.value="GenerarOS";
		frm.accion.value=opc;
		frm.submit();
		///alert('Generando');
	}  
	else return;	
}
function enviar(opc,accion){
	var frm=window.document.frmIdentidad;
	frm.hdnAccion.value=opc;
	frm.accion.value=accion;
	frm.submit();
}
{/literal}

</script>
<table width="100%" border="1">
  <tr class="f_impar">
    <td  class="t_cabecera">
       <b><p align="center" class="titulo">DETALLE DEL REQUERIMIENTO</p></b>
	</td>
  </tr>
</table>
<form name="frmIdentidad"  method='POST'>
<input type='hidden' name="hdnAccion" value=""/>
<input type="hidden" name="cod_requerimiento" value="{$cod_requerimiento}"/>
<input type="hidden" name="numero_orden" value="{$numero_orden}" />
<input type="hidden" name="cod_doc_visado" value="{$cod_doc_visado}" />
<!-- para generar  la  orden de salida -->
<input type="hidden" name="accion" value ='GenerarOS' >
<br>
	<table width="100%" align="center" class="tabla_gris" border='0'>
     {section name=x loop=$Lista}
      {if $smarty.section.x.first}
		<tr >
			<th nowrap>C&oacute;digo</th>
			<th nowrap >Producto</th>
			<th nowrap>Descripci&oacute;n</th> 
			<th nowrap >Unidad</th> 
			<th nowrap >Cantidad</th> 
			<th nowrap>Stock</th> 
			<th nowrap>Seleccionar</th> 
		</tr>
      {/if}
		<tr bgcolor="{cycle values="#e6e6e6,#f6f6f6"}">      
 			<td nowrap width='7%'>{$Lista[x].cod_producto}</td>
			<td nowrap width='20%'>{$Lista[x].producto}</td>
			<td nowrap width='33%' align='middle'><textarea disabled type='text' name='descripcion'>{$Lista[x].descripcion}</textarea></td>
			<td nowrap width='10%' align='middle'>{$Lista[x].unidad}</td>
			<!-- ##################### esto kiero validar #########################################-->
			<td nowrap width='10%' align='center'><input type="text" name="ca{$Lista[x].cod_producto}" value="{$Lista[x].cantidad}" size="8" dir="rtl"/></td>
			<td nowrap width='10%' align='center'><input type="text" name="st{$Lista[x].cod_producto}" value="{$Lista[x].stock}" size="8" dir="rtl" readonly/></td>
			<td nowrap width='10%' align='center'><input type="checkbox" name="cb{$Lista[x].cod_producto}" value="{$Lista[x].cod_producto}"></td>		
		</tr>
      {/section}
      <tr>
      		<td colspan=7></td>
      </tr>
      </table>
<br/>
<table width="100%"  align="center" >
	<tr>
		<td class='t_cabecera' align="center"><input type="button"  value="Cancelar"  onclick="javascript:Cancelar();" /></td>
	<tr>
</table>
</form>
{include_php file='libs/footer.php'}
bueno y tambien enviar esos datos a otra hoja q solamente se seleccionen
espero sua poyo gracias