Ver Mensaje Individual
  #4 (permalink)  
Antiguo 08/08/2013, 10:07
ruben_chirinos_1985
Invitado
 
Mensajes: n/a
Puntos:
Respuesta: como declarar funcion con php

hola amigos muchas gracias por responder aqui esta el formulario q uso para enviar los datos,

Código HTML:
Ver original
  1. <form id="form1" name="form1" method="post" action="" onSubmit="return validarPasswd()">
  2.       <div class="page-header">
  3.   <div class="styled_title">
  4.     <h1 align="left" class="Estilo135 Estilo136">DEPÓSITO / RETIROS EN CAJA DE AHORRO  </h1>
  5.   </div>
  6. </div>
  7.         <table width="774" align="center" bordercolor="#FFFFFF">
  8.           <tr bgcolor="#FFFFFF">
  9.             <td width="24">&nbsp;</td>
  10.             <td width="846"><table width="89%" border="0" class="table">
  11.                 <tr class="info">
  12.                   <td colspan="3"><center>
  13.                       <p class="info"><strong>DATOS PERSONALES DE LOS AHORRISTAS   </strong> </p>
  14.                   </center></td>
  15.                 </tr>
  16.                 <tr>
  17.                   <td width="35%"><label for="textfield"><strong>Código: </strong></label>
  18.                       <input name="cod_ahorro" type="text" id="cod_ahorro" value="<?php echo $num; ?>" size="2" readonly="readonly" maxlength="2" />
  19.                       <label for="textfield"><strong>Documento / Cedula:</strong></label>
  20.                       <input name="ced_socio" type="text" id="ced_socio" title="Escriba solo numeros para Cedula" onKeyUp="this.value=this.value.toUpperCase();" pattern="[0-9A-Z]{7,15}" placeholder="Cedula" required="required"/>
  21.                       <label for="textfield"><strong>Dirección:</strong></label>
  22.                       <input name="direc_socio" type="text" id="direc_socio" onKeyUp="this.value=this.value.toUpperCase();" size="40" placeholder="Direccion Domiciliaria" required="required" />
  23.                       <label for="textfield"><strong>Fecha de Proceso: </strong></label>
  24.                     <input name="fecha" value="<?php echo date("Y-m-d"); ?>" type="text" id="fecha" size="25" maxlength="25" readonly="readonly"/>
  25.                   </td>
  26.                   <td width="33%"><label for="textfield"><strong>Nº Libreta:</strong></label>
  27.                     <input name="num_libreta" type="text" id="num_libreta" title="Escriba solo numeros para Numero de Socio" onKeyUp="this.value=this.value.toUpperCase();" pattern="[0-9]{2,15}" size="15" placeholder="Nº de Libreta" required="required"/>
  28.                       <label for="textfield"><strong>Nombres: </strong></label>
  29.              <input name="nom_socio" type="text" title="Escriba solo letras para Nombres" pattern="[A-Za-z ]{1,35}" placeholder="Nombres" onKeyUp="this.value=this.value.toUpperCase();" id="nom_socio" size="40" maxlength="40" required="required"/>
  30.                       <label for="textfield"><strong>Telefono: </strong></label>
  31.                       <input name="tlf_socio" type="tel" id="tlf_socio" title="Escriba el Numero de 11 digitos ej. 042412345678" onKeyUp="this.value=this.value.toUpperCase();" pattern="[0-9]{10,12}" placeholder="Telefono"/><br>
  32.                     <label class="radio">
  33.               <input type="radio" name="proceso" id="proceso" value="DEPOSITO" required="required"/>
  34.               <strong>Dépositos</strong></label>
  35.               <label class="radio">
  36.               <input type="radio" name="proceso" id="proceso" value="RETIRO" />
  37.               <strong>Retiros</strong></label>
  38.                       </td>
  39.                   <td width="32%"><label for="textfield"><strong>Nº Socio :</strong></label>
  40.                   <input name="pco" type="text" id="pco" title="Escriba solo numeros para Cedula" onKeyUp="this.value=this.value.toUpperCase();" pattern="[0-9]{1,15}" size="15" placeholder="Nº del Socio" required="required"/><br>
  41.                     <label for="textfield"><strong>Apellidos: </strong></label>
  42.                     <input name="ape_socio" type="text" title="Escriba solo letras para Apellidos" pattern="[A-Za-z ]{1,35}" placeholder="Apellidos" onKeyUp="this.value=this.value.toUpperCase();" id="ape_socio" size="40" maxlength="40" required="required"/>
  43.                     <label for="textfield"><strong>Monto a Procesar: </strong></label>
  44.                     <div class="input-prepend input-append"> <span class="add-on">Bs.</span>
  45.                         <input name="monto" type="text" id="monto" pattern="[0-9.]{1,12}" title="Escriba solo numeros enteros o con decimales, como maximo tres enteros, y dos decimales y punto para separar los decimales" placeholder="Monto Bs. Deposito/Retiros" onKeyUp="this.value=this.value.toUpperCase();" required="required">
  46.                     </div>
  47.                     </td>
  48.                 </tr>
  49.                 <tr>
  50.                   <td colspan="3"><div align="center"><span class="form-signin">
  51.                     <input name="submit" value="Registrar" class="btn btn-large btn-primary" type="submit" />
  52.                     <input name="submit" value="Restablecer" class="btn btn-large btn-primary" type="reset" />
  53.                   </span></div></td>
  54.                 </tr>
  55.                 <tr></tr>
  56.             </table></td>
  57.         </table>
  58.       </form>

y solo quiero q se cumpla o se realice esa funcion cuando uno seleccione el radio button la opcion de retiro solamente aqui estan

<label class="radio">
<input type="radio" name="proceso" id="proceso" value="DEPOSITO" required="required"/>
<strong>Dépositos</strong></label>
<label class="radio">
<input type="radio" name="proceso" id="proceso" value="RETIRO" />
<strong>Retiros</strong></label>