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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:05:00+00:00 2026-05-17T21:05:00+00:00

I have a div that is being duplicated dynamically. After duping it, I need

  • 0

I have a div that is being duplicated dynamically. After duping it, I need to remove the name from the hidden input only, but can’t seem to be able to select it only. The majority of the file is prototype, but I have jQuery at my disposal (jq).

I have managed to get the name to disappear, but it clears them all out, I only want it cleared on the duplicated div.

Help appreciated.

function dupField(fieldName,container,dupediv){
    var container = $(container);
    var dupedDiv = $(dupediv).cloneNode(true);
    var totalins=jq("#MI_name > div").size();
    newNode=document.createElement('div');
    newNode.innerHTML=dupedDiv.innerHTML;
    newNode.setAttribute('id',dupediv+totalins);
    newNode.setAttribute('class','MI_inz');
    var inputs_txt = newNode.getElementsByTagName('input');
    var x = jq('#MI_label').val();
    for(j=0;j<inputs_txt.length;j++){//change text field names
            var nameNow = inputs_txt[j].name;
            var newName = nameNow+totalins;
            inputs_txt[j].name=newName;
            inputs_txt[j].value='';
    }
    container.appendChild(newNode);
    var nn=jq('newNode:hidden');//jQuery - this selects all the hidden's in the form-no good-only want to change hidden input in newNode
    var hid=jq(nn).attr('name','');
}

It’s the part after appendChild.

some of the other things I’ve tried:

var nn=jq('newNode:input(:hidden)');

–

var nn=jq(newNode).attr('id');
jq(nn+':hidden').attr('name','');

etc…

I’m sure it’s simple, but I can’t get it…

  • 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-17T21:05:00+00:00Added an answer on May 17, 2026 at 9:05 pm

    For an input where attribute type equals hidden:

    jq(newNode).find('input[type=hidden]');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a div that is hidden and being declared this way: <div id=divLogin
I have two div's that are being placed in the DOM after the page
I have a div that is absolutely positioned from the top left corner of
I have a page in which I have a div. The content from that
Ok so I have a div that contains a few forms that have dynamically
I have a div element like <div id=move>Something</div> ...that I'd like to move from
I have div with vertical scroll bar. Div is being updated dynamically via ajax
I have a div that is being used an a email newsletter signup form.
I have a div that is hidden until the user clicks on a link.
I have some document in a div that is being displayed, and I want

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.