web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Form Field Background ...
Power Pages
Suggested Answer

Form Field Background turns Blue how do I throw a Error Message if Background is Blue?

(1) ShareShare
ReportReport
Posted on by 516
I have a form, which this has Never been an issue prior, when the Wallet and or Saved Personal Data  popup causes the Text Box to turn blue.
 
 
I have turned off the items in Admin Center, however, I want to have an Error Message if the background of the Text Box is Blue.
 
I can not seem to find the Property item to have a message error saying  "Do not used the Wallet and or the Saved Personal Data."
 
 
How would I do this?
Categories:
I have the same question (0)
  • Jady Profile Picture
    147 on at
    This might be a CSS issue. Try looking though the HTML & CSS with your browser's Developer Tools. It might be a CSS pseudo element such as :focus that applies the background-color of blue. 
  • Suggested answer
    Inogic Profile Picture
    1,291 Moderator on at
    Hi,
     
    We are a bit unclear about your requirements.

    However, as per our understanding, you wish to display a message when the background of the text box is blue.

    To achieve this functionality, We have to use custom JavaScript within the form.

    Navigate to the Power Pages Management > Basic Form > Advance Settings (Tab) > Custom Scripts (Section)



    Paste the below code in the Custom JavaScript section,

    Adjust the code with your background Text Box Color.

    $(document).ready(function() {
       
        // Select all input elements in the form
        var $inputBoxes = $('input[type="text"], input[type="number"], input[type="email"], input[type="tel"], textarea');

        // Create and append the error message element to each input box
        $inputBoxes.each(function() {
            $(this).after('<div class="error-message" style="color: red; display: none;">Do not use the Wallet and/or the Saved Personal Data.</div>');
        });

        // Function to toggle error message visibility based on background color
        function toggleErrorMessage($input) {
            var $errorMessage = $input.next('.error-message');
            if ($input.css('background-color') === 'rgb(0, 0, 255)') {
                $errorMessage.show();
            } else {
                $errorMessage.hide();
            }
        }

        // Attach events to input boxes
        $inputBoxes.on('input focus', function() {
            toggleErrorMessage($(this));
        }).on('blur', function() {
            if ($(this).css('background-color') !== 'rgb(0, 0, 255)') {
                $(this).next('.error-message').hide();
            }
        });
    });

    Please refer the result given below,



    Hope this helps.
     
    Thanks!
    Inogic Professional Services: Power Platform/Dynamics 365 CRM
    An expert technical extension for your techno-functional business needs
    Drop an email at crm@inogic.com 
    Service: https://www.inogic.com/services/ 
    Tips and Tricks: https://www.inogic.com/blog/ 
  • Suggested answer
    SaiRT14 Profile Picture
    1,992 Super User 2025 Season 1 on at
    simple steps:
    • Set the OnSelect property or OnChange property of the text box
    • Create a label control for the error message and set its Visible property to display conditionally based on the background color.
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
11manish Profile Picture

11manish 46

#2
Valantis Profile Picture

Valantis 24

#2
omkarsupreme Profile Picture

omkarsupreme 24

Last 30 days Overall leaderboard