locked
html - use in search and replace - possibly with invisible html RRS feed

  • Question

  • User-1997257017 posted

    I currently have a 2010 web form application that generates html code when the application has finished executing. My requirement is that I make a second copy of the same html so a new letter can be generated. The only difference from letter #1 to letter #2 is the mailing address of the letters will be different. The rest of the letter will be exactly the same.

    My problem is when I actually have a copy of the letter, I have it completely. I do not have a copy of what the original address is. Thus when I am going to replace the address for the second letter, I need a way to be able to tell where the address of the first letter is located at.

    Thus my questions are:

    1. Thus I am thinking I can place some invisible characters around the first address that the user will not see. This way I will be able to replace the address in the second copy of the letter with the second address I want to embed.  Thus are there invisible html characters that I can embed around address 1 in the first letter so that I can place a new address in the second copy of the letter? If so can you tell me what those invisible characters are that I can use?

    2. If there are no invisible characters that I can use, are there other html tags that I can use to place around the original address that the user will not see?  Thus when I am working with the second copy of the letter, I can do the search and replace for these other html tags and place the second address in the second letter> Thus can you tell me what the other characters are?

    3. If my ideas listed above do not work, do you have any other suggestions that I can Use? If so, would you tell me how to accomplish my goal using your suggestion?

    Wednesday, October 26, 2016 10:41 PM

Answers

  • User-1838255255 posted

    Hi wendy Elizabeth,

    According to your description , As far as I know , you can use <input id="Hidden1" type="hidden" /> , this element can hide field , also can  be found and set value . I make a sample , this sample use jQuery and this element .

    Sample Code:

    <!DOCTYPE html>
    <html>
    <head>
        <title></title>
           <meta charset="utf-8" />
        <script src="Scripts/jquery-1.10.2.js"></script>
        <script>
            $(function () {
                $("#Hidden1").val("will@outlook.sg");
                })
        </script>
    </head>
    <body>
        <div>
            <input id="Hidden1" type="hidden" />
            <p>Hi XXX,</p><br />
            <p>The complaint letter should be addressed to the customer service/consumer affairs department or the head office if there is no customer service department. The address and contact information of the customer service department should be available on the company's products or website. </p>
        </div>
    </body>
    </html>
    

    Result:

    Best Regards,

    Eric Du

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, October 27, 2016 6:55 AM

All replies

  • User-1838255255 posted

    Hi wendy Elizabeth,

    According to your description , As far as I know , you can use <input id="Hidden1" type="hidden" /> , this element can hide field , also can  be found and set value . I make a sample , this sample use jQuery and this element .

    Sample Code:

    <!DOCTYPE html>
    <html>
    <head>
        <title></title>
           <meta charset="utf-8" />
        <script src="Scripts/jquery-1.10.2.js"></script>
        <script>
            $(function () {
                $("#Hidden1").val("will@outlook.sg");
                })
        </script>
    </head>
    <body>
        <div>
            <input id="Hidden1" type="hidden" />
            <p>Hi XXX,</p><br />
            <p>The complaint letter should be addressed to the customer service/consumer affairs department or the head office if there is no customer service department. The address and contact information of the customer service department should be available on the company's products or website. </p>
        </div>
    </body>
    </html>
    

    Result:

    Best Regards,

    Eric Du

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, October 27, 2016 6:55 AM
  • User-1997257017 posted

    Thank you for your answer so far!

    However I have the following additional items to mention:

    1. The html that I am using to generate the letters can not be used with jquery since the html is sent directly to an SSRS 2012 report. Thus can I use the hidden variable not with an input tag like you displayed? What other html tags could I use?

    2. In the example you displayed, it looks like the hidden line takes up space when your example is displayed. Thus does the hidden characters take up extra space on what is being displayed?

    3. If the hidden character takes up space of what is being displayed, is there a way for it not to take up room on what is being displayed?

    4. Are there other html tags that can be used that are not visible to the user? If so, what are they? Do you have a link to show what these other html tags (characters) are?

    Thursday, October 27, 2016 2:51 PM