1

How to style the dialog “onclick” button?

I have created a button with a “onClick” dialog, waiting for the user's response:

let check := dialog("Atención", "¿Confirma la eliminación de la transacción?", ["Si", "No"]);
if check = "Si" then
delete this;
openTable("Cuenta Nº 1", "all");
closeAllRecords()
else
closeRecord()
end

This is the result:


it works, but it does not have the appearance of the dialog box like the one in the trash can:

 

Further, when I add the styled function, the button does not work:
let check := dialog("Atención", "¿Confirma la eliminación de la transacción?", ["Si", "No"]);
styled ("Si", "red");
if check = "Si" then
delete this;
openTable("Cuenta Nº 1", "all");
closeAllRecords()
else
closeRecord()
end

How can I style the inner buttons of the dialog?
Regards, thanks in advance.

6replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
    • Sean
    • Sean
    • 9 mths ago
    • Reported - view

    I think you have to use a CSS hack to accomplish that. If you are using the Mac app you can edit the CSS file directly. If not, you can put this formula in a Formula field, but it only works if the Form is active.

     

    html("
    <style>
    .nx-button-text.grey:nth-child(4) {
    color: #e64e29;
    background-color: #ffe5e0;
    border: 1px solid #e64e29;
    }
    .nx-button-text.grey:nth-child(4):hover {
    background-color: #ffccc2;
    }
    .nx-button-text.grey:nth-child(4):active {
    background-color: #ffb2a3;
    }
    </style>
    ")

    Like 1
    • clonev
    • clonev
    • 9 mths ago
    • Reported - view

    Thank you. But, where should I write the code. sorry (I'm new to using javascript). Regards. 

    Like
    • Sean
    • Sean
    • 9 mths ago
    • Reported - view

    This is CSS not JavaScript. You have to add a Formula field on the same form where the button is located and enter the code in the Formula field. The field can't be hidden using "Display field only, if:", but you can camouflage it by setting the background color to the color of your form and set the "Label position" to "Hidden".

    Like
    • clonev
    • clonev
    • 9 mths ago
    • Reported - view

    Ok, I try it. Thank you

    Like
    • clonev
    • clonev
    • 9 mths ago
    • Reported - view

    Hi, Sean!

    The code works as I wanted it!!!, thanks.

    Like
    • Sean
    • Sean
    • 9 mths ago
    • Reported - view

    You're welcome. Glad you got it working :)

    Like
Like1 Follow
  • 1 Likes
  • 9 mths agoLast active
  • 6Replies
  • 242Views
  • 1 Following