Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6722681
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:28:33+00:00 2026-05-26T09:28:33+00:00

I have a jquery modal dialog, and I am trying to change the text

  • 0

I have a jquery modal dialog, and I am trying to change the text shown on a button after it is clicked. So, for example, the Send button gets changed to ‘Sending…’ and is disabled when it is clicked.

This all works fine, with one problem: the button loses all of its internal padding, and the button border wraps right around the text.

$('#email-dialog').dialog({
    autoOpen: false,
    height: 'auto',
    width: 'auto',
    modal: true,
    buttons: {
        "Send": function() {
            $(".ui-dialog-buttonpane button:contains('Send')").button("disable");
            $(".ui-dialog-buttonpane button:contains('Send')").button().html('Sending...');

            $.ajax({
                type: "POST",
                url: post_path,
                data: form_data,
                dataType: 'JSON',
                success: function(data) {
                    if (data.success) {
                        $("#email-dialog").dialog("close");
                    } else {
                        updateErrors(data.errors);
                        $(".ui-dialog-buttonpane button:contains('Sending...')").button("enable");
                        $(".ui-dialog-buttonpane button:contains('Sending...')").button().text('Send');
                    }
                },
                error: function(XMLHttpRequest, textStatus, errorThrown) {
                    alert('Error: ' + textStatus + ' ' + errorThrown);
                    $(".ui-dialog-buttonpane button:contains('Sending...')").button("enable");
                    $(".ui-dialog-buttonpane button:contains('Sending...')").button().text('Send');
                }
            });

        },
        Cancel: function() {
            $(this).dialog("close");
        }
    },
    close: function() {
        allFields.val("").removeClass("ui-state-error");
    }
});

I have tried with both the html() and text() methods. Am I missing something really obvious here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T09:28:34+00:00Added an answer on May 26, 2026 at 9:28 am

    If you have a look at the html at the button actually renders you’ll notice that there is a <span> inside the <button> tag.

    <button type="button" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" role="button" aria-disabled="false">
        <span class="ui-button-text">Send</span>
    </button>
    

    So to get your code to work, you should probably do something like:

    $(".ui-dialog-buttonpane button:contains('Send') span").text('Sending...');
    

    EDIT: As per mmcnickle’s comment, it looks like the jQuery UI Button has a label property that you can use. E.g.

    $(".ui-dialog-buttonpane button:contains('Send')").button('option', 'label', 'Sending...');
    

    jsFiddle of it in action

    jQuery UI Button Label Documentation

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to get the Jquery UI modal dialog to take over after
I have blinking text modal dialog box and slideshow with jquery. They working just
I have a jquery modal dialog that displays a partial view. The partial view
I have a problem with Jquery UI modal dialogs. I have modal dialog (dialogA),
I have a modal dialog plugin written in jquery, that binds to the click
I have this extremely basic jQuery UI Modal Dialog that I wrote for testing
I'm trying to add a jQuery UI modal dialog to show when a function
I have a jQuery Dialog form and on submit I'm trying to validate the
I am using jQuery UI dialog for modal popups. I have some iframes in
I have a problem while trying to upload using plupload and jquery ui dialog

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.