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

The Archive Base Latest Questions

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

How would I make a div (in this case, a submit button) disappear if

  • 0

How would I make a div (in this case, a submit button) disappear if a form input field contains just numbers. For example, I have a form like this:

<form action="submit.php" method="POST">
<input id="email" name="email" />
<input type="submit" class="btn btn-blue" id="email_btn" value="Send" />
<input type="submit" class="btn btn-blue" id="number_btn" value="Send To Number" />
</form>

If the input with the id “email” contains just numbers, (A 7 digit phone number with no dashes, “3245556347”), instead of something else, (A email address), the Send button disappears and the Send To Number remains.

Hopefully I could explain that correctly.

Thanks!

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

    This is one possibility: jsFiddle example

    var email = document.getElementById('email');
    email.onkeyup = function() {
        document.getElementById('email2').style.display = (this.value.search(/^\s*\d+\s*$/) != -1) ? 'none' : '';
    }​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

$(#tab1).click(function(){ loadTab(1); $('div.HOMEtabdiv ul.HOMEtabs a').removeClass('selected'); $(this).addClass('selected'); }); Would it be possible to make the
I would like to make one of the div's hidden while rendring. After page
I would like to position a div withing another element but make it stay
How would I go about correctly writing this so that the var input is
I would like to select all jquery UI button that live inside all <div>
I'm trying to make a div fade out with jquery after the form validates
Let's suppose the following use case: for a working example plese look at this
I'm using following line and I would like to make it case-insensitive: var matches
I have this model called Post, idaelly I would love to use just ONE
I would make to make a small WYSIWYG editor similar to the one used

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.