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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:30:36+00:00 2026-06-12T14:30:36+00:00

I have a ColdFusion cfform containing: <cfinput type=text name=part1 id=part1 tabIndex=1 onblur=enabled() > <cfinput

  • 0

I have a ColdFusion cfform containing:

<cfinput type="text" name="part1" id="part1" tabIndex="1" onblur="enabled()" >
<cfinput type="text" name="part2" id="part2" tabIndex="2" onblur="enabled()" disabled="disabled" >
<cfinput type="text" name="part3" id="part3" tabIndex="3" onblur="enabled()" disabled="disabled" >

What I want is let input box disabled unless its previous one is not empty, so I done this:

function enabled()
{
    var curIndex = + ( $( " * : focus " ).attr( " tabIndex " ) );
    var curVal = $( ' * : input [ tabIndex=' + curIndex + ' ] ' ).val();
    var nextIndex = curIndex + 1;
    var nextId = $( ' input [ tabIndex = " ' + nextIndex + ' " ] ' ).attr( " id " );
    if ( curVal == "" )
    {
        nextId.setAttribute( ' disabled ', ' disabled ' );
    }
    else
    {
        nextId.removeAttribute( ' disabled ' );
        nextId.focus();
    } 
} 

But I stuck with getting curIndex, it appeared ” undefined ” when I alerted it.

Any suggestion is appreciated.

  • 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-06-12T14:30:37+00:00Added an answer on June 12, 2026 at 2:30 pm

    What about:

    ​$('input[type=text][name^=part]').on('blur',function(){​​​​​​​​​​​
        var el = $(this);
        var elNext = el.next('input[type=text][name^=part]');
        if(el.val()!=''){
            elNext.removeAttr('disabled');
        }else{
            elNext.attr('disabled',true);
        }
    });
    

    So you don’t need the handlers on inputs:

    <cfinput type="text" name="part1" id="part1" tabIndex="1" > 
    <cfinput type="text" name="part2" id="part2" tabIndex="2" disabled="disabled" > 
    <cfinput type="text" name="part3" id="part3" tabIndex="3" disabled="disabled" >
    

    ​Demo

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

Sidebar

Related Questions

I have a button in Coldfusion: <cfinput name=Accept type=button value=Acknowledge onclick=ColdFusion.Window.hide('my_alert')> Currently the button,
i have some questions about constructors in ColdFusion : must i use the name
I have a coldfusion 8 webservice that returns an array <cffunction access=remote name=testMethod returntype=array>
here is the code I have got so far. <script language=JavaScript type=text/javascript> function onCancel()
We have ColdFusion and Active Directory running within the same domain. I'm trying to
I have a ColdFusion function foo which takes three args, and the second two
I have a ColdFusion script that does: <cfset content = replace(content,&##147;,,all)> Which replaces &147;
i have a coldfusion cfc and some methods in it. MethodA will return a
I have a Coldfusion CfChart Bar Graph, that has X-Axis = Questions, and Y-Axis
I have a coldfusion application running right now with a login that sends a

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.