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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:41:13+00:00 2026-06-15T23:41:13+00:00

I allow my users to import local and remote files, but how can I

  • 0

I allow my users to import local and remote files, but how can I use a single input to handle both cases ?

Like Stackoverflow, I can do it using tabs :

enter image description here

Or use radio buttons like :

<style>
    .displayNone {
        display:none;
    }
</style>

<form action="test.php">
    File type:
    <input id="radio-url" name="type" type="radio" checked value="url" /> URL
    <input id="radio-file" name="type" type="radio" value="file" /> File
    <div id="url">
        <input name="url" type="text" />
    </div>
    <div id="file" class="displayNone">
        <input name="file" type="file" />
    </div>
    <input type="submit" value="Send" />
</form>

<script type="text/javascript">
        $('#radio-url').click(function() {
            $('#url').removeClass('displayNone');
            $('#file').addClass('displayNone');
        });
        $('#radio-file').click(function() {
            $('#file').removeClass('displayNone');
            $('#url').addClass('displayNone');
        });
</script>

Gives a switchable :

enter image description here

But how can I create such a field :

enter image description here

Note for the whole question that the way of handling file on the remote host isn’t important.

  • 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-15T23:41:14+00:00Added an answer on June 15, 2026 at 11:41 pm

    I found a working way using CSS :

    <style>
        .container {
            position: relative;
        }
        .url {
            position: absolute;
            top:0;
            left:0;
            z-index:2;
        }
    </style>
    
    <form action="test.php">
        File or URL :
        <div class="container">
            <input name="file" type="file" />
            <input class="url" name="url" type="text" />
        </div>
        <input type="submit" value="Send" />
    </form>
    

    Gives an editable input type="text" above the input type="file" :

    enter image description here

    But I think this will be tricky because browsers layout and behaviour is different for the input type="file".

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

Sidebar

Related Questions

How can I allow users to upload files to their own, user designated folder,
I wanted to allow users to be able to add videos but I'm having
I'm trying to allow users to input multiple id #'s separated by commas in
I am wanting to allow users to tag items so that they can search
I want to allow users to import their Facebook education and experience entries into
Our app added functionality to allow users to import certain information from an excel
I want to allow users on my website to import contacts from their hotmail
I'd like to have real-time access to both interpreter input and error and standard
I am trying to allow users to import their Hotmail contacts to my site
It's necessary to allow users to import their data on the site (in mysql

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.