Using FP 2003 to search and replace literals with HTML entities in TEXTAREA

A

Ada

Hi;
I was wondering, how would I go about setting up a search and replace
to replace all literals within TEXTAREAs to their HTML entities
instead? I'm surprised FP2003 doesn't do this by default (like in
FP98). For example, lets say I have the following:

<TEXTAREA>
<script>
alert("hi")
</script>
</TEXTAREA>

I'd like FP2003 to change this portion of the page to:

<TEXTAREA>
&lt;script&gt;
alert("hi")
&lt;/script&gt;
</TEXTAREA>

This is needed in order for my pages to be XHTML compliant, obviously.

Thanks for any help.
 
J

Jim Buyens

-----Original Message-----
Hi;
Howdy.

I was wondering, how would I go about setting up a search
and replace to replace all literals within TEXTAREAs to
their HTML entities instead?

1. Openthe page.
2. Choose Replace from the Edit menu.
3. Set Find What to < and Replace With to &lt;
4. Click HTML rules.
5. Select the second line in the text box (New Rule...).
6. Set the drop-down list in the lower left corner of the
dialog box to Inside Tag.
7. A second drop-down list will appear, initialized to
[any tag]. Change this to textarea.
8. Click OK.
9. Click Replace All.

This only does < to &lt;. You can either repeat the
process to change > to &gt; or use regular expressions to
identify multiple search/replace patterns.

To save this Search/Replace configuration:

1. Click the diskette icon after Query, in the lower
right corner of the Find And Replace dialog box.
2. Give the query a name.
3. Click Save.

To use the saved settings in the future:

1. Display the Find And Replace dialog box.
2. Click the open folder icon after Query.
3. Select the saved query you want and click Open.

Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*------------------------------------------------------*
|\----------------------------------------------------/|
|| Microsoft Office FrontPage 2003 Inside Out ||
|| Microsoft FrontPage Version 2002 Inside Out ||
|| Web Database Development Step by Step .NET Edition ||
|| Troubleshooting Microsoft FrontPage 2002 ||
|| Faster Smarter Beginning Programming ||
|| (All from Microsoft Press) ||
|/----------------------------------------------------\|
*------------------------------------------------------*
 
A

Ada

Thanks Jim. I was hoping FP 2003 would support multiple rules at the
same time when doing a search and replace, but the fact that it
doesn't means anything more than 1 to 1 replacing requires regular
expressions. That's rather rediculous, especially since any decent s&r
programs these days support multiple rules.

Rather disappointed.
 
P

PS

Ada said:
Thanks Jim. I was hoping FP 2003 would support multiple rules at the
same time when doing a search and replace, but the fact that it
doesn't means anything more than 1 to 1 replacing requires regular
expressions. That's rather rediculous, especially since any decent s&r
programs these days support multiple rules.

Rather disappointed.

What program provides a way to execute multiple search and replace
queries at the same time?
 
A

Ada

PS said:
What program provides a way to execute multiple search and replace
queries at the same time?

A few, actually. I can't remember all their names, though the last one
I downloaded was called BK Replace Em' I believe. Very robust.
 
C

chris leeds

I think EditPlus, and a nice little plain text called NoteTab.

I use NoteTab for it's "clip library" which I hear fp 2003 has built in.
I'm looking forward to using fp 2003. as it is now I'm using fp 2002 in
tandem with notetab and topstyle.

it'd be nice to be able to use fp for everything but somehow I doubt it'll
have the .css capabilities of Topstyle. that's one heck of a program.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top