Foros del Web » Creando para Internet » Flash y Actionscript »

Formulario Flash con checkboxes??

Estas en el tema de Formulario Flash con checkboxes?? en el foro de Flash y Actionscript en Foros del Web. Hola de nuevo, tengo una duda y he estado buscando información relacionada con esto pero casi solo he consiguido tutoriales de formularios más sencillos. Tengo ...
  #1 (permalink)  
Antiguo 26/07/2008, 11:33
Avatar de fmurga  
Fecha de Ingreso: abril-2008
Mensajes: 53
Antigüedad: 15 años, 11 meses
Puntos: 0
Formulario Flash con checkboxes??

Hola de nuevo, tengo una duda y he estado buscando información relacionada con esto pero casi solo he consiguido tutoriales de formularios más sencillos.

Tengo este formulario en php:

El Script que envía el mail:

Código:
 <?
if (isset($_POST['isOK'])) {

	function checkString($s) {
		$s = str_replace("<","&lt;",$s);
		$s = str_replace("'","''",$s);
		$s = str_replace(chr(13),"<br>",$s);
		return $s;
	}

	$nombre=checkString($_POST['nombre']);
	$telefono=checkString($_POST['telefono']);
	$fax=checkString($_POST['fax']);
	$email=checkString($_POST['email']);
	$direccion=checkString($_POST['direccion']);
	$cotizar=checkString($_POST['cotizar']);
	$msg.="\n";
      if ($cotizar)
         for ($i=0;$i<count($cotizar);$i++)
            $msg.= "\n- $cotizar[$i]";
      else
         $msg.="\n- Ninguna Opción fue seleccionada";
	$mensaje=checkString($_POST['mensaje']);
		
	$to= "[email protected]";
	$subject= "Solicitud de Cotizacion";
	
	$messageSend= "<b>Nombre:</b> ".$nombre." <br>";
	$messageSend.= "<b>Telefono:</b> ".$telefono." <br>";
	$messageSend.= "<b>Fax:</b> ".$fax." <br>";
	$messageSend.= "<b>Direccion del Proyecto:</b> ".$direccion." <br>";
	$messageSend.= "<b>Email:</b> ".$email." <br>";
	$messageSend.= "<b>Necesita Cotización de:</b> ".$msg." <br>";
	$messageSend.= "<b>Mensaje:</b> ".$mensaje." <br>";
	$messageSend.= "<b>IP: </b>".$REMOTE_ADDR."\r\n<br>";
	$messageSend.= "<b>Browser: </b>".$HTTP_USER_AGENT."\r\n<br>";
	
	
	$headers  = "MIME-Version: 1.0\r\n";
	$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
	$headers .= "From: ME at server <[email protected]>\r\n";
	$headers .= "Reply-To: ".$email."\r\n";
	
	//mail($to, $subject, $messageSend);
	mail($to, $subject, $messageSend, $headers);
?>
Y luego el formulario que llena el usuario:

Código:
<form name="form1" method="post" action="cotiza.php">
	          <table width="80%" border="0" align="center" cellpadding="2" cellspacing="2">
          <tr>
            <td width="48%" align="right"><b>Nombre: </b></td>
            <td colspan="2" align="left">              <input type="text" size="30" maxlength="80" name="nombre">            </td>
          </tr>
          <tr>
            <td align="right"><b>Tel&eacute;fono: </b></td>
            <td colspan="2" align="left">              <input name="telefono" type="text" id="telefono" size="30" maxlength="12">            </td>
          </tr>
          <tr>
            <td align="right"><div align="right">              <strong>Fax: </strong></div></td>
            <td colspan="2" align="left">              <input name="fax" type="text" id="fax" size="30" maxlength="12">            </td>
          </tr>
          <tr>
            <td align="right"><div align="right">              <strong>E-</strong><b>mail: </b></div></td>
            <td colspan="2" align="left">              <input type="text" size="30" maxlength="80" name="email">            </td>
          </tr>
          <tr>
            <td align="right"><b>Direcci&oacute;n del Proyecto: </b></td>
            <td colspan="2" align="left">              <label></label>              <input name="direccion" type="text" id="direccion" value="" size="30">              </td>
          </tr>
          <tr>
            <td rowspan="14" align="right" valign="middle"><b>Cotizar sobre: <br>
                </b></td>
            <td width="4%" align="left"><input name="cotizar[]" type="checkbox" id="cotizar[]" value="Puertas de Entrada"></td>
            <td width="48%" align="left">Puertas de entrada</td>
          </tr>
          <tr>
            <td align="left"><input name="cotizar[]" type="checkbox" id="cotizar[]" value="Puertas Interiores"></td>
            <td align="left">Puertas interiores </td>
          </tr>
          <tr>
            <td align="left"><input name="cotizar[]" type="checkbox" id="cotizar[]" value="Puertas Francesas"></td>
            <td align="left">Puertas Francesas </td>
          </tr>
          <tr>
            <td align="left"><input name="cotizar[]" type="checkbox" id="cotizar[]" value="Interiores y exreriores de closets"></td>
            <td align="left">Interiores y exteriores de closets</td>
          </tr>
          <tr>
            <td align="left"><input name="cotizar[]" type="checkbox" id="cotizar[]" value="Walk-in closets"></td>
            <td align="left">Walk-in Closets </td>
          </tr>
          <tr>
            <td align="left"><input name="cotizar[]" type="checkbox" id="cotizar[]" value="Gabinetes de ba&ntilde;o"></td>
            <td align="left">Gabinetes de ba&ntilde;o </td>
          </tr>
          <tr>
            <td align="left"><input name="cotizar[]" type="checkbox" id="cotizar[]" value="Huellas y contrahuellas"></td>
            <td align="left">Huellas y contrahuellas</td>
          </tr>
          <tr>
            <td align="left"><input name="cotizar[]" type="checkbox" id="cotizar[]" value="Barandas y pasamanos"></td>
            <td align="left">Barandas y pasamanos </td>
          </tr>
          <tr>
            <td align="left"><input name="cotizar[]" type="checkbox" id="cotizar[]" value="Z&oacute;calos"></td>
            <td align="left">Z&oacute;calos</td>
          </tr>
          <tr>
            <td align="left"><input name="cotizar[]" type="checkbox" id="cotizar[]" value="Molduras en cielos y paredes"></td>
            <td align="left">Molduras en cielos y paredes </td>
          </tr>
          <tr>
            <td align="left"><input name="cotizar[]" type="checkbox" id="cotizar[]" value="Forros, envigados y machimbre en muros y cielos"></td>
            <td align="left">Forros, envigados y machimbre en muros y cielos </td>
          </tr>
          <tr>
            <td align="left"><input name="cotizar[]" type="checkbox" id="cotizar[]" value="P&eacute;rgolas"></td>
            <td align="left">P&eacute;rgolas</td>
          </tr>
          <tr>
            <td align="left"><input name="cotizar[]" type="checkbox" id="cotizar[]" value="Parquet"></td>
            <td align="left">Parquet</td>
          </tr>
          <tr>
            <td align="left"><input name="cotizar[]" type="checkbox" id="cotizar[]" value="Otros"></td>
            <td align="left">Otros</td>
          </tr>
          <tr>
            <td align="right" valign="top"><div align="right">              <strong>Mensaje: <br>
            <span class="style8">(Si tiene alguna observaci&oacute;n especial escr&iacute;bala en este espacio.)</span> </strong></div></td>
            <td colspan="2" align="left">              <textarea name="mensaje" cols="40" rows="4" id="mensaje"></textarea>            </td>
          </tr>
          <tr>
            <td height="26">&nbsp;</td>
            <td colspan="2"><input name="submit" type="submit" onClick="MM_validateForm('nombre','','R','telefono','','RisNum','email','','RisEmail','direccion','','R');return document.MM_returnValue" value="enviar"></td>
          </tr>
        </table>
        <input type="hidden" name="isOK" value="OK">
		<input name="$REMOTE_ADDR" type="hidden" id="$REMOTE_ADDR" value="$REMOTE_ADDR">
        <input name="$HTTP_USER_AGENT" type="hidden" id="$HTTP_USER_AGENT" value="$HTTP_USER_AGENT">
      </form>
Las dudas son:

1.- ¿Se pueden crear checkboxes en el formulario?

Si la respuesta es afirmativa:

2.- ¿Cómo agrupar la variable $cotizar para que la reconozca en el flash y la pase al script php?

Gracias por la ayuda.

Última edición por fmurga; 26/07/2008 a las 11:35 Razón: corrección del nombre de la variable $cotizar
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 14:48.