Check if input is saved before moving to next one

Posted on 2011-10-10
Last Modified: 2012-05-12
I have form where user can fill out the information. The form is very long and for each of the row there is an insert button (plz see the image). Sometimes a user will fill out something in the text box but forget to save the value(click insert in this form) and move to the next one. In this case I want to change the color of that td to something else. How can I do that?
Question by:PranjalShah
    LVL 81

    Accepted Solution

    put the following in the head section of your page :
    <script language="javascript" type="text/javascript" src=""></script>
    <script language="javascript" type="text/javascript">
        $(document).ready(function() {
            $(":text","td").change(function() {
            $("input[value*='Insert']").click(function() {
                $(this).closest("tr").find("td :text").css("background","");

    Open in new window

    LVL 8

    Author Closing Comment

    Thanks a lot...

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
    Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now