ReReplacer

Replacing text when other text is present

5 months 1 week ago #77308

Joe Matassino's Avatar Joe Matassino

Using ReReplacer to change the color of a module title (information module), works perfectly. On the same page I also have RSFormPro in a separate module (form module) and would like to be able to change the text in the title of the information module when the text in the form module changes. Here is the example:

Information Module Title: INFO_LEFT - ReReplacer changes INFO_LEFT to "Left Module Title Welcome"
Form Module has a submit button, and after the form is submitted, it displays a "Thank You Message".

I would like ReReplacer to be able to conditionally change INFO_LEFT from "Left Module Title Welcome" to "Left Module Title Thank You" when "Thank You" is displayed after the form is submitted.

Is this possible?

5 months 1 week ago #77309

Peter van Westen's Avatar Peter van Westen Admin

Depends on how that form module works.
Does it reload the page on submit?
Do you have this online so I can take a look?

5 months 1 week ago #77310

Joe Matassino's Avatar Joe Matassino

I believe it does reload the page, but I can force it to reload if it doesn't.
pharmacylocator *dot* com *slash* nuvessa

5 months 1 week ago #77311

Peter van Westen's Avatar Peter van Westen Admin

You could search for something unique in either of the 2 cases.
For instance, you can replace it with the welcome message if it can also find the form tag. And replace it with the thank you message in all other cases.
Like:
Search (Regular Expressions: Yes, Search Area: Body)

INFO_LEFT(.*?<form method="post"  id="userForm")
Replace:
Left Module Title Welcome

Second replacement:
Search:
INFO_LEFT
Replace:
Thank You Message