I have an AJAX call in which if the form processing result is SUCCESSFUL, I I want to show in the SAME kind of modal dialog a Title bar that says "SUCCESS!!!", a body with the following text
"
Thank you for choosing the Teal Center. Your appointment request has been sent and you will receive an email confirmation. This is only a *request* for an appointment. You will receive a second notification to inform you whether or not your request can be accommodated.
"
and only show a CLOSE "X" and Close button.
Can someone assist me in inserting the right syntax to get this to happen. I appreciate it.
Here is my code:
- $(function() {
- var $div = $('.req_link');
- $('.req_link').button()
- .css({
- 'text-decoration' : 'none',
- 'background' : '#2C8586',
- 'color' : 'white',
- 'width' : '90px',
- 'font-size' : '0.8em'
- }).hover(function() {
- $(this).css({
- 'background' : '#2BA6CB',
- 'color' : 'white'
- });
- }).mouseleave(function() {
- $(this).css({
- 'background' : '#2C8586',
- 'color' : 'white'
- });
- });
- $(".req_link").click(function() {
- if($("#tx_types").val() == '' ) {
- alert('You must select a Treatment Type first.');
- return false;
- }
- $availability_href = $(this).attr("href");
- $('#dialog').load($availability_href+"&js=1");
- $('#dialog').dialog("open");
- return false;
- });
- $("#dialog").dialog({
- title: 'Request Appointment',
- autoOpen: false,
- draggable: false,
- position: "center top+40 window",
- width: 400,
- resizable: false,
- modal: true,
- buttons: {
- Cancel: function() {
- $(this).dialog('close');
- },
- "Request Appointment": function() {
- $(".ui-dialog-buttonpane button:contains('Request Appointment')").button("disable");
- $.ajax({
- type: 'POST',
- url: 'ajax/rad_process.php?js=1',
- data: $('#dialog form').serialize(),
- cache: false,
- error: function(xml, status, error) {
- $('#dialog').html('<p><strong>Error Code:</strong> '+status+'</p><p><strong>Explanation:</strong> '+error+'</p>');
- },
- success: function(html) {
- $("#dialog").dialog('close');
- /*$("#conf_msg").html(html);*/
- $("#loading").html("<img src=\"/images/ajax-loader.gif\" height=\"14\">");
- $.ajax({
- type: 'POST',
- url: 'ajax/req_appt_success.php?js=1',
- data: $('#av_list_form').serialize(),
- cache: false,
- error: function(xml, status, error) {
- $("#loading").html("");
- $('.tblha').html('<tr><td colspan=\"8\"><p><strong>Error Code:</strong> '+status+'</p><p><strong>Explanation:</strong> '+error+'</p></td></tr>');
- },
- success: function(html) {
- $("#loading").html("");
- $(".tblha").html(html);
-
- alert('SUCCESS!!! Thank you for choosing the Teal Center. Your appointment request has been sent and you will receive an email confirmation. This is only a *request* for an appointment. You will receive a second notification to inform you whether or not your request can be accommodated.')
- }
- });
- $("#conf_msg").show();
- $(document).scrollTop( $("#conf_msg").offset().top );
- }
- });
- return false;
- }
- }
- });
- });