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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:06:12+00:00 2026-05-25T22:06:12+00:00

I have this question. I have a input type text and a button. Like

  • 0

I have this question. I have a input type text and a button. Like this html:

<form id="browser-form">
    <div class="filebrowser">
        <input type="text" id="browser-filepath">
    </div>
    <div class="upload submit"> 
        <a href="#" id="browser-submit" class="button">Uploaden</a> 
    </div>
</form>

But the question is. When the input type is empty. Je can not click on the button. When the input type is fil. Than you can click on the button. How can i fix that?

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-05-25T22:06:13+00:00Added an answer on May 25, 2026 at 10:06 pm

    Assuming I’ve understood your question correctly, I think you want to prevent the link from doing anything unless the input has a value. If that’s correct, then you can do this:

    $("#browser-submit").click(function(e) {
        if(!$("#browser-filepath").val()) {
           e.preventDefault();
        } 
    });
    

    preventDefault is a method of the event object which, as the name suggests, prevents the default action of an event (in this case, following the link).

    Here’s a working example of the above.

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

Sidebar

Related Questions

I have this: <input type=text value=Enter Password class=password /> ... onclick/onfocus, I'd like to
Familiar with creating textfields in a form like this example:- Name :<input type=text name=visitor
I have this question: Does implementing a custom MembershipProvider class needs you to implement
I have this question relating to Lucene. I have a form and I get
I have an HTML form consisting of some text-inputs. I'm using jqTransform to prettify
I have the following structure in a form: <div class='full'> <div class='half'> <label>Book</label> <select
Let's say I have an input: <input type=text id=smth value= /> and I have
I have this piece of javascript: <script type=text/javascript> function show_confirm() { var type =
In this page there's a way to dynamic add html (textbox,input button and radio
I have this question in which I have a SQL Server Compact Edition database

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.