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 7679949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T17:59:46+00:00 2026-05-31T17:59:46+00:00

i am trying to apply some condition for an Auto generated textfield, the script

  • 0

i am trying to apply some condition for an Auto generated textfield, the script objective is to edit-in-place user data by using Jquery, which is working fine, what i need here is to apply if the text field was empty , an alert message will popup

here is my Jquery code

$(document).ready(function() {
         $('#inplace_field').blur(function(){
         if ($('#inplace_field').html(''))
         {
             alert ("its empty");
         }
        });
    });

the auto generated field will come if i click on a specific data that is called inside a <p></p> html paragraph.

when i click the paragraph will call automatically a text field that has the existed value inside it and it will be ready to change like this

<p id="userEmailAddress" class="givemeMarginHere editInPlace-active" style="background-color: transparent; ">
<form class="inplace_form" style="display: inline; margin: 0; padding: 0;">
<input type="text" name="inplace_value" class="inplace_field" id="inplace_field" size="null">
<button class="inplace_save" value="">Save</button> 
<button class="inplace_cancel" value="">Cancel</button>
</form></p>

The Problem

my Jquery function doesn’t show my alert even if let the textfield empty and moved to another object by clicking tab, it doesn’t work.

-i want to mention that i called Jquery library and it works perfect with other Jquery scripts inside the page
– also #inplace_field is a unique id element.

  • 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-31T17:59:47+00:00Added an answer on May 31, 2026 at 5:59 pm

    To my understanding, selector.html(“any content”) sets the html value of the selected object. What you want to do is retrieve the html value and compare it to blank.

         if ($('#inplace_field').html() == "")
         {
             alert ("its empty");
         }
    

    I’ve also had good luck using .text() and .val(), depending on what effect you’re going for.

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

Sidebar

Related Questions

I am trying to apply some transformations on images using a CGContextRef. I am
I have some jquery and am trying to apply a delay to it but
I'm trying to apply CSS styles to some HTML snippets that were generated from
i'm trying to apply some module system on my web, using get and include,
I am trying to apply a method to an existing object which involves using
Im facing problem when trying to apply data annotation. In my case im passing
I am trying to apply some CSS class on the options of a drop
I am trying to apply some conditional formatting on a WPF DataGrid.The requirement is
I'm starting to read about design patterns and trying to apply them to some
I'm trying to do some parsing of a bunch of haskell source files using

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.