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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:57:35+00:00 2026-06-16T03:57:35+00:00

http://jsfiddle.net/3Sd4W/ Reference: The above js fiddle provided by greener . If the new Entry

  • 0

http://jsfiddle.net/3Sd4W/

Reference: The above js fiddle provided by greener.

If the new Entry Button is clicked, there is an layout issue for that new added object.

The text box style is:

file.setAttribute("style", "margin-top: 60px;");

But I want the text box to be in the middle and not at the bottom. I tried myself but it doesn’t works for me. Anybody could help me to solve this problem?

  • 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-16T03:57:37+00:00Added an answer on June 16, 2026 at 3:57 am

    Your code is extremely complicated to read, so this may help:

    HTML:

    <form name="addpoll">
    
    <div id="choices">
    
    
    </div>
    <input id="addchoice" type="button" value="Add New Entry">
    
    </form>
    

    JS:

    function addnewDiv(counterAppended) {
        counterAppended = parseInt(counterAppended) + 1;
        var text = document.createElement("div");
        text.innerHTML = '<input type="hidden" class="choicecount" name="choicecount" id="choicecount" value="' + counterAppended + '">\
    <input type="file" name="choiceimg' + counterAppended + '" value ="Select"  onchange="readURL(this)" style="display:none;">\
    <div>\
    <div style="width:400px;height:85px;">\
    <div id="imgbg" style="float:left;width: 110px;height: 80px;text-align: center;border: 1px solid #CCC;">\
    <input type="button" onclick="HandFileButtonClick();"  value="Browse" id="firstremove" style="margin-top: 30px;" class="addmultiple">\
    </div>\
    <div style="float:right;margin-top: 30px;">\
    <input type=text name="choicename' + counterAppended + '" id="firstremove2">\
    <input type="button" value="Remove" class="remove" id="firstremove3" style="color: red; font-size: 12px; border: 0px; background: none; text-decoration: underline;">\
    </div>\
    </div>\
    <img src="#" name="viewimg' + counterAppended + '" class="addmultiple" id="viewimg' + counterAppended + '" height="70px" width="85px" style="display:none"/>\
    <br>\
    </div>\
    <span id="file"></span>';
        text.id = 'choice' + counterAppended;
        document.getElementById("choices").appendChild(text);
        document.getElementsByClassName("remove")[document.getElementsByClassName("remove").length - 1].addEventListener("click", function() {
            this.parentNode.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode.parentNode);
        });
    }
    
    function HandFileButtonClick() {
        document.addpoll.choiceimg1.click();
    }
    
    function HandleFileButtonClick(val) {
        var ss = val.name;
        document.forms["addpoll"]
        var n = ss.split("choiceimgs");
        document.forms["addpoll"]["choiceimg" + n[1]].click();
    }
    document.getElementById("addchoice").addEventListener("click", function() {
        var choicecounts = document.getElementsByClassName('choicecount');
        addnewDiv(choicecounts[choicecounts.length - 1].value);
    });
    
    addnewDiv(0);
    

    JsFiddle: http://jsfiddle.net/99vhF/1/

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

Sidebar

Related Questions

http://jsfiddle.net/k8s4j/6/ Given the fiddle above, I am stuck... In Chrome it claims that the
http://jsfiddle.net/gUckp/ In the above demo, I'd like to show an orange round image BELOW
http://jsfiddle.net/4UbKe/3/ Please check out the fiddle to see exactly why it doesn't work. I'm
http://jsfiddle.net/mjmitche/gq6En/62/ this fiddle allows you to drag and drop little boxes into the white
http://jsfiddle.net/mjmitche/gq6En/78/ In this fiddle, if you drag the orange box into the white box,
http://jsfiddle.net/2CkKW/5/ I'm trying to have a button for comments in which you will press
http://jsfiddle.net/bSnaG/ In my mind the above example should look like a grey box with
http://jsfiddle.net/MzqYL/3/ In the example above the border of the frame is thinner than the
http://jsfiddle.net/LUfgY/ It doesn't show it there but if that code is run on normal
http://jsfiddle.net/PerryCS/zFewp/2/ Hi there, I have played around with this for ~6 hours now and

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.