Hi there,
I've signed up on this forum in the hope that one of the Reg Experts can help me though a problem. I'm working on a site which is an exchange for MindManager maps. Users can upload their own maps and enter in title, description and tags etc.
I am currently using a regular expression to remove all traces of HTML from the desciption field before saving to the db when a user adds a new map. This works just fine, however, I would like people to be able to include a hyperlink or two in the description if they so desire.
My goal is to remove all attributes other than:
Target must for forced to "_blank".
I don't want any onclick, class, id etc attributes left in.
Here's an example:
User input - <a href="http://www.mycoolsite.com" onclick="sneakyFunction()" name="myLink" class="clsLink">Visit my cool site</a>
Becomes - <a href="http://www.mycoolsite.com" target="_blank">Visit my cool site</a>
I plan to use the RegExp replace function to achieve this (provided I can sort out the pattern!)
I am using ASP VBScript on this site.
If anyone could offer some advice on this I would be most grateful!
All the best,
Nick