I am using thickbox and the form plugin and this is my problem.

I am not getting a result from the code execution.
Here is my javascript.

<script type="text/javascript">//<![CDATA[
        $('#formTurn').click(function() {
            $('#TB_window #yourTurnForm').ajaxForm({
                        dataType:  'json',
                target: '#TB_window #output',
                success:   processyourTurnForm
        });
        });
function processyourTurnForm(data) {
$("#formTurn").fadeOut("fast")
$(data.message).appendTo("#TB_window #TB_output")
}
</script>

and here is the php code i am using

$storyId =  $_GET['storyId'];
$title = stripslashes($_GET['title']);
$opinion = stripslashes($_GET['opinion']);
$userId = $_SESSION['userid'];
$site_mysql->add_you_turn($storyId,$title,$opinion,$userId);

echo '{ message: " Thank you " }';

shouldnt  echo '{ message: " Thank you " }'; return to the form?

here is the code for the window
<div id="formTurn"><form id="yourTurnForm" target="TB_iframeContent"  
class="thickbox" action="includes/site_mysql_class.php? 
g=yourTurn&height=500&width=500">
<input type="hidden" name="storyId" value="'.$_GET[storyId].'"\>
Title: <br/><input type="text" width="300" name="title"><br/>
Opinion: <br/><textarea id="opinion" name="opinion" rows="20"  
cols="50"></textarea>
<br/><input type="submit" value="Submit you story">
</form>
</div>

Thanks


TJ



_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to