SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Dec 2011
    0 Post(s)
    0 Thread(s)

    running a php script after a query function completes

    I'm having trouble figuring out how to run a php script after a jquery script runs. I have a form that is using uploadify to display a status bar and upload an attachment to the server. After that runs I want to run a php script to store all of the other form data. Here is a simplified version with just one post variable (title).

    <form action="" method="post" >
    		<div id="queue"></div>
    		<input type="text"  name="title" placeholder="Video Title..." />
    		<input id="file_upload" name="file_upload" type="file">
    		<button class="submit" type="button" value="Upload" onclick="javascript:$('#file_upload').uploadifive('upload')">Submit Form</button>
    	<script type="text/javascript">
    		$(function() {
    				'auto'         : false,
    				'formData'     : {'test' : 'something'},
    				'queueID'      : 'queue',
    				'uploadScript' : 'uploadifive.php',
    				'onUploadComplete' : function(file, data) {

  2. #2
    Under Construction silver trophybronze trophy AussieJohn's Avatar
    Join Date
    Sep 2005
    Sydney, Australia
    11 Post(s)
    0 Thread(s)
    Assuming your onUploadComplete event fires correctly it should be pretty easy to fix this

    I think what you're trying to do is POST the <form>, however $("form") returns a jQuery object of a DOM Node which does not have the .post() method.

    If you'd like to post the data from the form you'd have to do it using $.post and manually add the data, e.g.:

    Code javascript:
    $.post("receiver.php", { name: "John", email: "" }, function( data ) { /* do something with data */ });
    // of course if you just want to send the form data, you could do something like:
    $.post("receiver.php", $("#your-form").serialize(), function( data ) { /* do something with data */ });

    var details = {
    . . web: "",
    . . photos: "",
    . . psa: ""


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts