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

  • Home
  • SEARCH
  • 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 6137791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T17:46:15+00:00 2026-05-23T17:46:15+00:00

I im creating a javascript file using addElemend and childAppend to add a new

  • 0

I im creating a javascript file using addElemend and childAppend to add a new

Ive written the code here http://jsfiddle.net/faYMH/18/

But for some reason it isnt working. If I replace the file upload field within the innerhtml with a simple it does work!

Can anyone spot the problem / put in some input how to accomplish what i want?

Thanks!

Jonah

  • 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-23T17:46:16+00:00Added an answer on May 23, 2026 at 5:46 pm

    There’s a few things wrong with that.

    JSFiddle problems

    First of all, you still have the framework settings set to “onLoad” and “Mootools”. You’ll want it to be one of the “no wrap” options and “No-Library (pure JS)”. Secondly, you’re putting the script in a script tag in the HTML pane. There’s a JavaScript pane specifically for JavaScript.

    JavaScript problems

    You have some inline HTML in your JavaScript:

    newDiv.innerHTML = "<input type="file" name="file1 + i++" />";
    

    You’re using double quotes (") for your JavaScript string as well as inside the HTML. Try using single quotes for the JavaScript string delimiters, like this:

    newDiv.innerHTML = '<input type="file" name="file1' + (i++) + ' />';
    

    The HTML inside the string is also not valid. It will try to generate HTML like this:

    <input type="file" name="file10 />
    

    There’s no closing quote. Fix that:

    newDiv.innerHTML = '<input type="file" name="file1' + (i++) + '" />';
    

    You might also want to remove the stray 1, though it doesn’t break the script.

    Result

    Here it is, after these changes and a few more.

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

Sidebar

Related Questions

While creating JavaScript with ASP.NET MVC I noticed several scope warnings and realized that
I am creating a large table dynamically using Javascript. I have realised the time
I am creating a chunk of HTML/JavaScript with the below code: $result = mysql_query(SELECT
I'm creating the following div using javascript, task_id is an int and person_name is
Im creating a usercontrol which is controled client side, it has an javascript-file attatched
I'm creating a javascript 2D array from an XML file which I then manipulate
I'm creating a Firefox add-on that does the following: Drag+drop a file into Firefox
I am creating HtmlButton dynamically in .cs file. Adding it to Panel using HtmlButton
Is there a way of creating a global function in Xul (using javascript, I
I am using asp.net 4.0. i am creating the Url with the help of

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.