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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T11:49:06+00:00 2026-06-14T11:49:06+00:00

I have this script where I use a slider to show some elements of

  • 0

I have this script where I use a slider to show some elements of a form. So far so good. The way I’m doing it is by having a slider (can’t use a multistep form since it uses a plugin not allowing multistep forms, plus some graphic behaviors) and a button that goes to the next slider. So now I need that button (not part of the form) to show only if a certain field is filled.

I tried teh following, but it’s not working, I assume some error but can’t figure what. My code is as follows:

$('#clientname').change(function() {
    var clientVal = $("input").val() == '';
$(".next").hide();

if ($('#clientname').val() != '').show();

else

$('.next').hide();
});

and the html as follows:

<div class="b40-right">


                        <h3>The Basics</h3>
                        <div class="label"> Your Name (required)</div>
                        <div class="inputes"> <span class="wpcf7-form-control-wrap your-name"><input id="clientname" type="text" name="your-name" value="" class="wpcf7-form-control wpcf7-text wpcf7-validates-as-required" size="40" /></span> </div>
                        <div class="label">Your Email (required)</div>
                        <div class="inputes">    <span class="wpcf7-form-control-wrap your-email"><input type="text" name="your-email" value="" class="wpcf7-form-control wpcf7-text wpcf7-email wpcf7-validates-as-required wpcf7-validates-as-email" size="40" /></span> </div>
                        <div class="label">Type of Business</div>
                        <div class="inputes">    <span class="wpcf7-form-control-wrap type-of-business"><textarea name="type-of-business" class="wpcf7-form-control  wpcf7-textarea" cols="40" rows="10"></textarea></span> </div>



                    </div>

                    <a class="next" href="javascript:stepcarousel.stepBy('mygallery2', 1)"><img id="nextbut1" src="<?php bloginfo('template_directory'); ?>/images/next.png" alt="" /></a>

any help on what am I doing wrong? Is there a better approach/solution? (I’m not a programmer as you may figure)

Thank you in advance!

  • 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-14T11:49:08+00:00Added an answer on June 14, 2026 at 11:49 am

    If I understand you correct, I believe this is what you are trying to achieve:

    $(function () {    
        $('#clientname').change(function() {
           if ($(this).val().length === 0)
              $('.next').hide();
           else
              $('.next').show();
        });
    });
    

    Whenever the value of the input with ID clientname changes, we check the length of the value (the number of characters entered in the input). If the length is zero, we hide the button, otherwise we show it.

    I also wrapped it in a DOM-ready callback to make sure that we don’t try to add the change-event listener until we know that the element is present in the DOM.

    Edit:

    The above example could also be written even shorter, like this:

    $(function () {    
        $('#clientname').change(function() {
            $('.next').toggle($(this).val().length !== 0);
        });
    });​
    

    Demo:

    A fiddle to demonstrate the code: http://jsfiddle.net/uQyH9/

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

Sidebar

Related Questions

I have this script: #!/var/home/cherry/opt/perl use Test::More; use DBI; use Test::mysqld; use Data::Dumper; my
I have a script we use. What I need a portion of this to
I literally have a script like this: $(function() { $( sliderRange ).slider({ range: true,
I am having an issue with the nivo slider JQuery script. I have the
I have this script that run to fix my menu bar to the browser
I have this script and need to be able to call the $play variable
I have this script set up that echoes all relevant users in a database
I have this script in the head of my index.html. I want different scripts
I have this script $('head').append('<link rel=stylesheet href=css/file1.css type=text/css />'); $('head').append('<link rel=stylesheet href=css/jquery.jscrollpane.css type=text/css />');
I have this script http://jsfiddle.net/gphp/ZMmRv/4/ I have two events: 1 - the div is

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.