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?
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
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
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?
Member
286 Points
582 Posts
html - use in search and replace - possibly with invisible html
Oct 26, 2016 10:41 PM|wendy elizabeth|LINK
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?
Contributor
6730 Points
2715 Posts
Re: html - use in search and replace - possibly with invisible html
Oct 27, 2016 06:55 AM|Eric Du|LINK
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:
Result:
Best Regards,
Eric Du
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
Member
286 Points
582 Posts
Re: html - use in search and replace - possibly with invisible html
Oct 27, 2016 02:51 PM|wendy elizabeth|LINK
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?