Cita:
Iniciado por laratik Para realizarlo automáticamente no creo que exista un método, por lo cual toca capturar los datos que vas a enviar, darle formato (nom1=val1&nom2=val2&nom3=val3) y enviarlos por método POST:
xmlHttp.open("POST", url, true);
xmlHttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');
xmlHttp.send(nom1=val1&nom2=val2&nom3=val3);
Muchas gracias por tu respuesta, me podrias ayudar a armar el codigo? soy bastante novato en javascript y ajax. Posteo el codigo de mi formulario para que veas los campos que contiene
Código HTML:
<form method="post" name="regform" action="modulos_carbono/registro2.php">
<tr>
<td height="100" colspan="2"><div align="center" class="Estilo15"><span class="style1 Estilo14 Estilo1">Registro</span></div></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td width="50%"><div align="right" class="normal_text_white Estilo5">Cuenta</div></td>
<td width="50%"><div align="left"><strong>
<input name="cuenta" id="cuenta" type="text" class="post" size="14" maxLength="10">
</strong></div></td>
</tr>
<tr>
<td width="50%"><div align="right" class="Estilo5 normal_text_white">Nombre</div></td>
<td width="50%"><div align="left"><strong>
<input name="nombre" id="nombre" type="text" class="post" size="14" maxLength="10">
</strong></div></td>
</tr>
<tr>
<td width="50%"><div align="right" class="Estilo8">Clave</div></td>
<td width="50%"><div align="left"><strong>
<input name="pass" id="pass" type="password" class="post" size="14" maxLength="10">
</strong></div></td>
</tr>
<tr>
<td width="50%"><div align="right" class="Estilo7 Estilo8 normal_text_white">Repetir Clave</div></td>
<td width="50%"><div align="left"><strong>
<input name="repass" type="password" id="repass" class="post" size="14" maxLength="10">
</strong></div></td>
</tr>
<tr>
<td width="50%"><div align="right" class="Estilo7 Estilo8 normal_text_white">E-Mail</div></td>
<td width="50%"><div align="left">
<strong>
<input name="email" class="post" type="text" id="email" size="14" maxLength=40>
<input type="hidden" class="post" value="11111111111" maxLength="12" name="personalid" id="personalid" size="14">
</strong></td>
</tr>
<tr>
<td width="50%"><div align="right" class="normal_text_white Estilo15"><span class="Estilo7"><span class="Estilo8">Pregunta Secreta</span></span></div></td>
<td width="50%"><div align="left"><strong>
<input name="psec" type="text" id="psec" class="post" size="14" maxLength="10">
<span class="Estilo5">?</span></strong></div></td>
</tr>
<tr>
<td width="50%"><div align="right" class="Estilo7 Estilo8 normal_text_white">Respuesta Secreta</div></td>
<td width="50%"><div align="left"><strong>
<input name="rsec" type="text" id="rsec" class="post" size="14" maxLength="10">
</strong></div></td>
</tr>
<tr>
<td width="50%"><div align="right" class="Estilo7 Estilo8 normal_text_white">Nacionalidad</div></td>
<td width="50%"><select name="pais" class="select Estilo16" id="pais">
<option value="Argentina">Argentina</option>
<option value="Albania">Albania</option>
<option value="Algeria">Algeria</option>
<option value="Angola">Angola</option>
<option value="Armenia">Armenia</option>
<option value="Australia">Australia</option>
<option value="Austria">Austria</option>
<option value="Azerbaijan">Azerbaijan</option>
<option value="Bahamas">Bahamas</option>
<option value="Bahrain">Bahrain</option>
<option value="Bangladesh">Bangladesh</option>
<option value="Belarus">Belarus</option>
<option value="Belgium">Belgium</option>
<option value="Bolivia">Bolivia</option>
<option value="Botswana">Botswana</option>
<option value="Brazil">Brazil</option>
<option value="Brunei">Brunei</option>
<option value="Bulgaria">Bulgaria</option>
<option value="Burkina+Faso">Burkina Faso</option>
<option value="Cameroon">Cameroon</option>
<option value="Canada">Canada</option>
<option value="Chile">Chile</option>
</select></td>
</tr>
<tr>
<td width="50%"><div align="right" class="Estilo7 Estilo8 normal_text_white">Codigo</div></td>
<td width="50%"><strong>
<input type="hidden" name="extcode" id="extcode" value="<? print("$random"); ?>">
<input type="text" class="post" maxLength="4" name="personalid" id="personalid" size="4" value="<? print("$random"); ?>" disabled="disabled">
</strong></td>
</tr>
<tr>
<td width="50%"><div align="right" class="normal_text_white Estilo8 Estilo7">Ingresar Codigo</div></td>
<td width="50%"><div align="left">
<strong>
<input class="post" type="text" size="4" maxlength="4"name="extcode1" id="extcode1">
</strong></td>
</tr>
<tr>
<td width="50%"><div align="right"><strong>
<input type="submit" name="crear" value="Crear Cuenta" class="button" onclick="generaPeticion ('modulos_carbono/registro2.php')">
</strong></div></td>
<td width="50%"><div align="left"><strong>
<input type="reset" name="borrar" value="Limpiar" class="button">
</strong></div></td>
</tr>
</form>