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
https://forums.phpfreaks.com/topic/249492-problem-with-load-null-value/
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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.