function myTester(thetitle)
{
$('<div>'+
'<input type="text" id="testrequest" placeholder="What is the name?" size="60"/>'+
'</div>').dialog({
dialogClass:'shareClass',
title: thetitle,
width: 600,
height: 300,
close: function(event, ui) { $(this).remove(); },
position: ['center','center'],
modal: false,
buttons: [
{
text: "Send Request",
click: function() {
$.ajax({
url:'forms/sendResults.php',
var testrequest=$("#testrequest").val(),
type:'post',
data: $(testrequest).serialize(),
success:function(result){
$("button").html(result);
}
});
$( this ).dialog( "close" );
}
},
{
text: "Close",
click: function() {
$( this ).dialog( "close" );
}
}
]
});
function myTester(thetitle)
{
$('<div><input type="text" id="testrequest" placeholder="What is the name?" size="60"/></div>').dialog({
dialogClass:'shareClass',
title: thetitle,
width: 600,
height: 300,
close: function(event, ui) { $(this).remove(); },
position: ['center','center'],
modal: false,
buttons: [
{
text: "Send Request",
click: function() {
$.post('forms/sendResults.php', { testrequest: $(testrequest).val() }, function(result){ alert(result);$("button").html(result);});
$( this ).dialog( "close" );
}
},
{
text: "Close",
click: function() {
$( this ).dialog( "close" );
}
}
]
});
}
This is what I have in the php script.
<?php echo "this is my test and should post value ".$_POST['testrequest'];
It should echo the value from the dialog. The value is not posting to php script