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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T19:12:14+00:00 2026-05-22T19:12:14+00:00

I need to prepend a huge DIV block, which can be seen at the

  • 0

I need to prepend a huge DIV block, which can be seen at the bottom of the question.

My current idea would be to put inside one

$('#content').prepend();

and break each like up, when I need to insert the content of a variable. That would be all the places which says TMPL_VAR

The code would be quite hard to maintain and read.

Is there a clever way to do this?

<form action="" method="post">
  <input name="anchor" value="<TMPL_VAR ID>" type="hidden">
  <div class="row">
    <div class="cellData">                                                          <TMPL_VAR ID>                                  </div>
    <div class="cellData"> <input name="title" id="<TMPL_VAR ID>_title"      value="<TMPL_VAR TI>" type="text" />                  </div>
    <div class="cellData"> <input name="owner" id="<TMPL_VAR ID>_owner"      value="<TMPL_VAR OW>" type="text" />                  </div>
    <div class="cellData"> <input name="from"  id="<TMPL_VAR ID>_begin_date" value="<TMPL_VAR BD>" type="text" class="datepick" /> </div>
    <div class="cellData"> <input name="to"    id="<TMPL_VAR ID>_end_date"   value="<TMPL_VAR ED>" type="text" class="datepick" /> </div>
    <div class="cellData cellRadios"> <input name="ctype" value="individuel" type="radio" <TMPL_VAR IN>/> Individuel <br> <input name="ctype" value="course" type="radio" <TMPL_VAR CO>/> Course </div>
    <div class="cellEdit"> <a href="javascript:showhide('<TMPL_VAR ID>');">Members</a> <input value="Save" type="submit">                 </div>
  </div>
  <div id="<TMPL_VAR ID>" style="display: none; background-color: #fff8e7;">
    <div class="rowMembers">
      <span>
    <label> Users  </label> &nbsp; <input name="users"  id="<TMPL_VAR ID>_users"  size="35" value="<TMPL_VAR US>" type="text" /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <label> Groups </label> &nbsp; <input name="groups" id="<TMPL_VAR ID>_groups" size="35" value="<TMPL_VAR GR>" type="text" />
      </span>
    </div>
  </div>
</form>
  • 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-22T19:12:15+00:00Added an answer on May 22, 2026 at 7:12 pm

    I would personally go for jQuery.tmpl() to handle this sort of issue.

    This way you could specify a template like so:

       <script type="text-x-jquery/template" id="template"> 
        <form action="" method="post">
          <input name="anchor" value="${id}" type="hidden">
          <div class="row">
            <div class="cellData">                                                          <TMPL_VAR ID>                                  </div>
            <div class="cellData"> <input name="title" id="${id}_title"      value="${ti}" type="text" />                  </div>
            <div class="cellData"> <input name="owner" id="${id}_owner"      value="${ow}" type="text" />                  </div>
            <div class="cellData"> <input name="from"  id="${id}_begin_date" value="${bd}" type="text" class="datepick" /> </div>
            <div class="cellData"> <input name="to"    id="${id}_end_date"   value="${ed}" type="text" class="datepick" /> </div>
            <div class="cellData cellRadios"> <input name="ctype" value="individuel" type="radio" ${in}/> Individuel <br> <input name="ctype" value="course" type="radio" ${co}/> Course </div>
            <div class="cellEdit"> <a href="javascript:showhide('${id}');">Members</a> <input value="Save" type="submit">                 </div>
          </div>
          <div id="${id}" style="display: none; background-color: #fff8e7;">
            <div class="rowMembers">
              <span>
            <label> Users  </label> &nbsp; <input name="users"  id="${id}_users"  size="35" value="${us}" type="text" /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <label> Groups </label> &nbsp; <input name="groups" id="${id}_groups" size="35" value="${gr}" type="text" />
              </span>
            </div>
          </div>
        </form>
        </script>
    

    and then with jQuery populate the template with

      $('#template').tmpl(myData).appendTo('#myContainer')
    

    which will insert the populated template into #myContainer given that you have data in the javascript scope myData wich corresponds to the data format specified in the template, and that you have defined a html element with an id of myContainer which is appendable.

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

Sidebar

Related Questions

Need some help to solve this. I have a gridview and inside the gridview
I need to prepend a single value to an IEnumerable (in this case, IEnumerable<string[]>
I am creating XML using a while loop, but now I need to prepend
I have an SQLite database from which I need to delete records periodically. What
I have a document which has a nested frameset. I need to access one
I need to prepend h1 to #columns but after #left_column , now it is
I have a user supplied text and I need to prepend all backslashes and
I have a need to add or prepend elements at the beginning of an
I need to prepend (newest first) new divisions to my .container but after .controls
Supposing a query such as: SELECT * FROM tableA; How can I prepend a_

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.