issue sending post form data via AJAX to php driven site

issue sending post form data via AJAX to php driven site

Hi,

I'm new to jquery and having trouble accomplishing what seems to be a simple task.  I am trying to send some variables to an existing website but for some reason the data is not being submitted at all.  I'm sure i'm just missing something simple here but like i said i'm a newbie so could someone please take a look at this:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.min.js">
</script>

<script type="text/javascript" >

$.post("http://www.website.com/formProcess.php", { subject: "test sub", message: "test message", id: "12345" });

</script>

note that everything works fine if i send it via a standard html form:

<SCRIPT LANGUAGE="JavaScript"><!--
setTimeout('document.send_message_form.submit()',5000);
//--></SCRIPT>

<form id="send_message_form" method="post" action="http://www.website.com/formProcess.php" name="send_message_form" onsubmit="return false;">
<input type="hidden" id="subject" name="subject" value="test subject">                           
<input type="hidden" id="message_text" name="message" value="test message">                             
<input type="hidden" id="id" name="Id" value="12345" />                            
</form>

what am i doing wrong here?

 



























    • Topic Participants

    • keith