Hello, I've been trying to submit a Form to a php file to send an
email. I've already tested the script without jquery, to make sure
the php works ok.
I haven't been able from the examples to know how to do it. This is
the last I tried:
This is what I have in my script tag in the head:
$(document).ready(function(){
$("input#submit").click(function(){
var params = $("[EMAIL PROTECTED]").serialize(); /*I try to get
all the input fields here into value pairs*/
$("div#msg").ajax({
type:"POST";
url:"sendmails.php";
data:params;
success:function(msg){
alert("sent ok! "+ msg);
}
});
});
});
and this is my form:
<form id="videos">
<input type="hidden" name="uri" value="http://www.canaldevideos.com<?
php print $_SERVER["SCRIPT_NAME"];?>"/>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td colspan="2" class="boldy">From:</td>
</tr>
<tr>
<td><label for="t_name">Name:</label></td>
<td><label for="t_email">Email:</label></td>
</tr>
<tr>
<td><input type="text" name="t_name"></td>
<td><input type="text" name="t_email"></td>
</tr>
<tr>
<td colspan="2" class="boldy">Your Message
(opcional):</textarea></td>
</tr>
<tr>
<td colspan="2"><textarea id="message"
name="message"></textarea></td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="Send"
id="submit"/></td>
</tr>
</table>
</form>
But the data goes through the adress bar, and it's totally messed up.
Any examples I can follow? I'm reading the "Ajax" documentation, and
that's mainly where I'm trying to copy my examples from.
-Thanks,
Gaston
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/