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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T01:41:11+00:00 2026-06-02T01:41:11+00:00

I made an input file type via javascript. Input type file generated as I

  • 0

I made an input file type via javascript.

Input type file generated as I expected except I can’t see the browse button.

I searched input file type css styling but all I see was how to customize

the browser button. Below is how my screen looks like.

enter image description here

normally, file type should be appeared as second one but I am getting first one when I

generate a file type in javascript. below is my code.

<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<style>
.uploadForm{
type:file; position:relative;
}

#addBtn{
width:100px; height:20px;
}
</style>
<script>
function addMoreFiles(){
var fileForm = document.createElement('input');
var addButton = document.createElement('button');   
addButton.setAttribute('onclick', "addMoreFiles()");
addButton.setAttribute('id', "addBtn");
fileForm.className = 'uploadForm';
document.getElementById('uploadDiv').appendChild(fileForm);
document.getElementById('uploadDiv').appendChild(addButton);
}
</script>
</head>
<body onload="addMoreFiles()">
<form name="frmname" method="post" enctype="multipart/form-data" action="./ViewPage.jsp">
file<br>
<div id="uploadDiv"></div>
<br>
<input type="file" name="uploadFile"><br>
<input type="submit" value="upload"><br>
</form>
</body>
</html>

Can anybody tell me what am I doing wrong? Thanks 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-02T01:41:13+00:00Added an answer on June 2, 2026 at 1:41 am
    var fileForm = document.createElement('input');
    fileForm.type = 'file'; // only <input type="file"> has browse button
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi, I have a couple of input type file elements like this : <input
I have made a code -- <?php header(Content-type: text/javascript); require_once('../php/config.php'); $domail_theme = $_GET['theme']; ?>
I made a dynamically multi upload form with file type inputs. When you select
I made a program: import collections x = input(Enter in text: ) x_counter =
I have made a phone bill system takes input of phone number called, date
I made a custom control that is basically a multiline TextBox that allows input,
I have made a little app for signing up for an event. User input
i made a file to print out the image file with W and H
I have defined a for loop as follows which scans through a file made
How to use in C# function from Win32 DLL file made in Delphi. When

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.