Jump to content

problem with load - null value


felito

Recommended Posts

hi

 

i have this code:

 

<script type="text/javascript">
$(document).ready(function() {

function doAjax(url) {
    $("#customForm").submit(function() {
        var formdata = $("#customForm").serializeArray();
        $.ajax({
            url: url,
            type: "post",
            dataType: "json",
            data: formdata,
            success: function(data, data1) {

                switch (data.livre) {

                case 'tituloLivre':
                    $("#msgbox2").fadeTo(200, 0.1, function() {
                        $(this).html('Titulo Livre').fadeTo(900, 1);
                    });
                    break;
                    
                default:
                    $("#msgbox2").fadeTo(200, 0.1, function() {
                        $(this).html('Active a sua conta e pode efectuar o login!').fadeTo(900, 1, function() {
                        	$('#conteudo').load('dojo/test_Slider.php');

                        });
                    });
                    break;
                }
            }
        });
        return false;          
    });
}
doAjax('sent.php');
doAjax('dojo/test_Slider.php');   
});
</script>

 

and test_Slider.php

 

<?php
include ('includesMy.php');
$form = $_POST['item'];
$oferta = $form['oferta'];

var_dump($oferta);
echo json_encode ($oferta);
?>

 

i should load the php file with ajax influence, but when i made load (test_Slider.php) obviously i get null because is independent of ajax call.

 

My question is, how can i load a whole php file that is changed by ajax call ?  (json return is not the solution because i have much more content, like graphics elements in test_Slider.php)

 

 

 

 

 

 

Link to comment
Share on other sites

ok, but i will get null value to $oferta.

The main problem is that output of php file depends of ajax call.

 

if i submit "programmer"or "designer" word, when i make the load();,  i must see the previous input.

 

At the moment, when i make load(); i will get always null, because is independently of input.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.