First thank for looking. First let me state I really am lame at Javascript. I'll try and be as helpful as I can. I have 2 ASP.NET forms. 1 has a button on it. The second is a form with a button on it to submit. I am not using an inline hidden div. I am using Colorbox, the most current version as of 3/20/13. I am using VS 2012 4.5. Jquery 1.9. I would like to launch form 2 from form 1... have the user fill in the information click the submit button on it and display in the SAME colorbox that it was submitted and allow them to close the Colorbox with the X. So far here is aprox where I am. I have changed this so many times I'm kind of lost. Most of this ick is from code I found.
Form 1 to launch Form 2 (works as expected)
$(".nameofbuttonclassform1").colorbox({ transition: "fade", width: "800", height: "680", overlayClose: false, href: "Form2.aspx" });
Form 2 button click displays Form 1 in the Colorbox and kills the postback to do the serverside work Does NOT work as needed. I have tried many variations of this so I'm plugging this in since its closer then anything else.
$('#Form2Submitbutton').click(function(e){
e.preventDefault();
var url = $(this).attr('href');
$.ajax({
type: 'GET',
url: url,
dataType: 'html',
cache: true,
beforeSend: function () {
$('#cboxLoadedContent').empty();
$('#cboxLoadingGraphic').show();
},
complete: function () {
$('#cboxLoadingGraphic').hide();
},
success: function (data) {
$('#cboxLoadedContent').append(data);
}
});
});
So I am completely stuck. If you have any ideas, they have to be better then mine.