Hello,
i want my users to be able to create events and the event to be shown on their wall.
I have this that shows a photo that they upload.
<div id="imageupload" class="border">
<form id="imageform" method="post" enctype="multipart/form-data" action='message_image_ajax.php'>
<div id='preview'>
</div>
<div id='imageloadstatus'>
<img src='<?php echo $base_url;?>wall_icons/ajaxloader.gif'/> Uploading please wait ....
</div>
<div id='imageloadbutton'>
<span id='addphoto'>Add Photo:</span> <input type="file" name="photoimg" id="photoimg" />
</div>
<input type='hidden' id='uploadvalues' />
</form>
</div>
i have done this
<div id="event_container" class='border'>
<form action="announce_event.php" id="eventform" method="post" enctype="multipart/form-data">
<div id='preview_event'>
</div>
<div id='eventloadstatus'>
<img src='<?php echo $base_url;?>wall_icons/ajaxloader.gif'/> Uploading please wait ....
</div>
<div align="center">
<div>
<span>Event Title: </span>
<span><input type="text" size="50" name="event_title" id="event_title"></span>
</div><br />
<div>
<span>Add an Image/Poster of the Event </span>
<span><input type="file" name="event_img" id="event_img"></span>
</div><br>
<div id='eventloadbutton'>
<INPUT class=AudioSearchButton id="eventvalues" name="Events" type='submit' value='Announce an Event'> or <a href="">Cancel</a>
</div>
</div>
</form>
</div>
And this is the javascript code
$(".update_button").click(function()
{
var updateval = $("#update").val();
var uploadvalues=$("#uploadvalues").val();
var eventvalues=$("#eventvalues").val();
var X=$('.preview').attr('id');
var Y=$('.webcam_preview').attr('id');
var A=$('.preview_event').attr('id');
if(X)
{
var Z= X+','+uploadvalues;
}
else if(Y)
{
var Z= uploadvalues;
}
else if(A)
{
var Z= eventvalues;
}
else
{
var Z=0;
}
var dataString = 'update='+ updateval+'&uploads='+Z;
if($.trim(updateval).length==0)
{
alert("Please Enter Some Text");
}
else
{
$("#flash").show();
$("#flash").fadeIn(400).html('Loading Update...');
$.ajax(
{
type: "POST",
url: "message_ajax.php",
data: dataString,
cache: false,
success: function(html)
{
$("#webcam_container").slideUp('fast');
$("#event_container").slideUp('fast');
$("#flash").fadeOut('slow');
$("#content").prepend(html);
$("#update").val('').focus().css("height", "40px");
$('#preview').html('');
$('#webcam_preview').html('');
$('#preview_event').html('');
$('#uploadvalues').val('');
$('#eventvalues').val('');
$('#event_img').val('');
$('#photoimg').val('');
var c=$('#update_count').html();
$('#update_count').html(parseInt(c)+1);
}
});
$("#preview").html();
$("#preview_event").html();
$('#imageupload').slideUp('fast');
$('#eventupload').slideUp('fast');
}
return false;
});
$('#event_img').die('click').live('change', function()
{
var values=$("#uploadvalues").val();
$("#preview_event").html('<img src="wall_icons/loader.gif"/>');
$("#eventform").ajaxForm({target: '#preview_event',
beforeSubmit:function(){
$("#eventloadstatus").show();
$("#eventloadbutton").hide();
},
success:function(){
$("#eventloadstatus").hide();
$("#eventloadbutton").show();
},
error:function(){
$("#eventloadstatus").hide();
$("#eventloadbutton").show();
} }).submit();
var A=$('.preview_event').attr('id');
var Z= A+','+values;
if(Z!='undefined,')
{
$("#eventvalues").val(Z);
}
});
on the anounce_event.php i made it to return the event_title value and all i get is an alert box with the event_title value
any help?