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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T23:24:59+00:00 2026-05-21T23:24:59+00:00

I am trying to clone part of a form without including the information that

  • 0

I am trying to clone part of a form without including the information that the user inputs into the first form. I am using the In-Field Labels jQuery Plugin.

When I use val(”) to address this problem, the value of the input is not duplicated, but the watermark for the In-Field Labels plugin doesn’t appear as it should – it’s just blank.

Does anyone have any suggestions on how to resolve this problem, or even how to make the code I have more efficient/correct? Thank you.

(function() {
var count = 0;

  $('#add-standard-button').live('click',function () {

    var source = $('.details'),
        clone = source.clone();

    clone.find('.copyme').val('').attr('id', function(i, val) {
        return val + count;
    });
    clone.find('.copyme').val('').attr('name', function(i, val) {
        return val + count;
    });
    clone.find('.placeholder').val('').attr('for', function(i, val) {
        return val + count;
    });

    clone.insertAfter('.details:last');

    count++;

});

HTML:

<div class="details" id="standard-details">
  <div class="markName">
    <p>
     <span class="markName-field">
      <label for="markName" class="placeholder">
       <span>Watermark Text Goes Here</span>
      </label>
      <input type="text" name="markName" id="markName" class="copyme">
     </span>
   </p> 
 </div>
</div>
  • 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-21T23:24:59+00:00Added an answer on May 21, 2026 at 11:24 pm

    Set the title tag on your inputs and then pull your default value from that.

    clone.find('.copyme').val( $(this).attr('title').attr('name', function(i, val) {
            return val + count;
    

    See an example: http://jsfiddle.net/4KLU5/

    Or you could use HTML5 data tags

          <input type="text" data-default="default text" name="markName" id="markName" class="copyme">
    

    and

      clone.find('.copyme').val( $(this).data('default') ).attr('name', function(i, val) {
            return val + count;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am attempting to clone fields in a form using Jquery. I'm trying to
I'm trying to clone my personal fork on github using the git+ssh protocol with
I am trying to clone my project on google code svn into a local
I'm using Isapi Rewrite 3 (mod rewrite clone for IIS) and trying to rewrite
I am trying to have a form of text inputs. All inputs will in
First i must state that i'm jsp/servlet rookie trying to learn it's mechanisms. INTRO:
I'm trying to implement a workaround to the problem of using AJAX with multi-part
I am trying to create an email form that allows you to send an
I'm trying to have a form that when you select the radio button it
I am trying to write to a specific line part using Stream Writer, here's

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.