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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:12:57+00:00 2026-06-18T08:12:57+00:00

I am creating a fill in the blanks client side application using JS/JQUERY that

  • 0

I am creating a “fill in the blanks” client side application using JS/JQUERY that will read in an XML file retrieved from AJAX call.

Inside the XML is a node that contains a string with tags that identify where fields will go.

To try and improve the UI experience I am formatting the display of this form on the webpage using divs as follows

<div id="prologue"></div>
<div id="message"></div>
<div id="epilogue"></div>

I want to read through the string and use control statements to check where that part should go in those divs mentioned above.

Here is a sample string from the text node

${Prologue} – Dear ${Title} ${Surname}. This is a message from The Company. An person called but was unable to gain access, a new appointment has been made for ${ProductName} with order number ${VOLNumber}, on ${AppointmentDate} between ${AppointmentSlot}. Please ensure you are available at your premises for the engineer. If this is not convenient, go to thecompany.com or call 01111 1111 111 before 12:00 noon the day before your appointment. Please refer to your order confirmation for details on what will happen on the day. ${Epilogue}

Assumptions are quite simple, anything that is not ${Prologue} or ${Epilogue} goes in the “message” div

I have the pseudo code here

for loop through the string
if ${prologue} put inside prologue div tags
if !=$prologue and !=$epilogue then place in message div tag
if ${epilogue} then put inside epilogue div tags

There will be some other rules I will create in the loop e.g. when a “.” character then insert a line break tag

The output should come to something like this

<div id="prologue">
${prologue}
</div>
<div id="message">
Dear ${Title} ${Surname}. <br/>
This is a message from The Company. An person called but was unable to gain access, a new appointment has been made for ${ProductName} with order number ${VOLNumber}, on ${AppointmentDate} between ${AppointmentSlot}. <br/>

Please ensure you are available at your premises for the engineer. If this is not convenient, go to thecompany.com or call 01111 1111 111 before 12:00 noon the day before your appointment. Please refer to your order confirmation for details on what will happen on the day. <br/>

</div>
<div id="epilogue">
${epilogue}
</div>

Could someone identify what features in javascript or jquery I could use for this implementation. I was thinking of using the .map() jquery function however I am not sure if this will work for my situation.

No full code solutions please! Just teasers so I can figure it out on my own!

EDIT

Here is a screenshot of my unformatted display

enter image description here

Thanks

  • 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-18T08:12:58+00:00Added an answer on June 18, 2026 at 8:12 am

    Since the prologue and epilogue are at the beginning and end, you don’t really need to have them in your template. So in your template engine, replace ${prologue} and ${epilogue)} with "", as you don’t need them (assuming you have no control over the xml), and insert your input elements directly into the divs.

    $('#prologue').append('<input type="text" id="prologueText"/>');
    $('#epilogue').append('<input type="text" id="epilogueText"/>');
    

    If you are dynamically creating the divs, you can prepend the prologue div with the prologue input, and append the epilogue div and epilogue input to a container div. You didn’t want to specific info, so I’ll stop there.

    So your output would be:

    <div id="prologue">
    <input type="text" id="prologueText"/>
    </div>
    <div id="message">
    Dear ${Title} ${Surname}. <br/>
    This is a message from The Company. An person called but was unable to gain access, a new appointment has been made for ${ProductName} with order number ${VOLNumber}, on ${AppointmentDate} between ${AppointmentSlot}. <br/>
    
    Please ensure you are available at your premises for the engineer. If this is not convenient, go to thecompany.com or call 01111 1111 111 before 12:00 noon the day before your appointment. Please refer to your order confirmation for details on what will happen on the day. <br/>
    
    </div>
    <div id="epilogue">
    <input type="text" id="epilogueText"/>
    </div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating an application for a company that will fill form in windows
I am creating a program that will fill in a given grammar. Right now
I'm creating a class that renames a file using a user-specified format. This format
Creating a server-side socket will fail if I'm trying to use the same port
I have a form that a user would fill out while creating a ticket
I'm creating a a web page scraper. I'm attempting to fill a JTable from
I am creating a test file and I need to fill it with random
I am creating a really basic program, that has a method to fill an
I'm creating a little newsletter application, with 'double opt-in restrictions', when I simply fill
When creating sub-processes in java using Runtime.exec() , I am aware that I have

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.