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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:33:16+00:00 2026-06-13T21:33:16+00:00

This seems like a fairly simple thing, but the issue has been giving me

  • 0

This seems like a fairly simple thing, but the issue has been giving me some trouble for a long time now. I have a submit button that is ‘disabled’ when a select list value is ‘select’. What I want is to html(‘select an area’)…but the button is disabled. Here is the code:

<script>
//setting the variable for first-shown select value
var selVar = $('#areaSel').val();
//disabling submit if first-shown value is 'select'
if(selVar == 'select'){
    $('#areaSubmit').prop('disabled',true);
}
//setting the variable if the selection changed & disabling submit if = 'select'
$('#areaSel').change(function(){
    var selVar = $('#areaSel').val();
    if(selVar == 'select'){
       $('#areaSubmit').prop('disabled',true);
    //removing 'disabled' submit if selection !== select
    }else{
        $('#areaSubmit').prop('disabled',false);
    }
});
    //giving the message to 'select an area
$('#areaSubmit').click(function(){
    var selVar = $('#areaSel').val();
    if(selVar == 'select'){
    $('#areaE').html('select an area');
    }
});
</script>

Im just trying to make the message ‘select an area’ appear instead of submitting when clicked. The problem is that the button is disabled when ‘select’ is selected. Thanks in advance for the help!

  • 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-13T21:33:17+00:00Added an answer on June 13, 2026 at 9:33 pm

    while the submit button is disabled click event won’t fire;so the html of your tag won’t change. move the code relative to changing the content of ‘areaE’ to some where else, may be the change event of your select

    http://jsfiddle.net/QFWYE/1/

    var selVar = $('#areaSel').val();
    //disabling submit if first-shown value is 'select'
    if(selVar == 'select'){
        $('#areaSubmit').prop('disabled',true);
    }
    //setting the variable if the selection changed & disabling submit if = 'select'
    $('#areaSel').change(function(){
        var selVar = $('#areaSel').val();
        if(selVar == 'select'){
           $('#areaSubmit').prop('disabled',true);
             $('#areaE').html('select an area'); 
        //removing 'disabled' submit if selection !== select
        }else{
            $('#areaSubmit').prop('disabled',false);
             $('#areaE').html(''); 
        }
    });
        //giving the message to 'select an area
    $('#areaSubmit').click(function(){
        var selVar = $('#areaSel').val();
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This seems like another fairly simple thing to do, but I'm again struggling on
This seems like it would be fairly simple, but I've been unable to find
This seems like it should be fairly simple, but for some reason I can't
This seems like a fairly obvious question, but I haven't been able to think
This seems like such a simple issue but I cannot find an elegant solution.
I'd like to count and group rows by specific values. This seems fairly simple,
I think this question is probably fairly simple, but I've been searching around and
This seems like a really simple question; but I can't see how it's actually
This seems to me like a very simple question, but I can't seem to
I am trying to do something fairly simple but seems like a near impossible

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.