www.Inmagic.com    Inmagic Forums    Inmagic Forums  Hop To Forum Categories  WebPublisher PRO    Email link and ampersand & character
Go
New
Find
Notify
Tools
Reply
  
-star Rating Rate It!  Login/Join 
Posted
I have created a mailto link on our Library's full record display (DB/TEXT Webpublisher pro v. 10)for our Library users to easily send us a request to borrow an item. When the user clicks on the 'request this item from Library' link on the full record, a prepopulated (title, author pub date information is already filled in the email) email opens up on the client's desktop. The user clicks send and the request is automatically emailed to us. I notice when there are certain characters in the title field like ampersand & , when the email launches everything after the & ampersand is chopped off. Any ideas on a fix would be of help.
 
Posts: 11 | Registered: Tue September 05 2006Reply With QuoteEdit or Delete MessageReport This Post
Posted Hide Post
Deborah,

I am trying to create an email link with the RecordID embedded in the message. Would you send me the html you used? Thanks
Elaine
 
Posts: 5 | Location: Eugene, OR, US | Registered: Wed June 25 2003Reply With QuoteEdit or Delete MessageReport This Post
Zoe
Posted Hide Post
I have a mailto link that works from a button click. Strangely, when I use Firefox or Chrome and launch our mail program (GroupWise) from there, ampersands are converted to & in the Subject line, but if I launch from IE, the ampersand just stays an ampersand. All my other special characters work pretty well (single and double quotation marks, etc.) and nothing disappears.

Here's the code I'm using (note that my field names are Film Title and Year and AutoNumber). Everything else is fixed text or added text. Also note that I developed this code because I was having problems with double quotes that appear in some of our film titles. It turns out double quotes are a big problem for an email subject line, but I found a tip that recommended replacing double quotes with double apostrophes. That's what's going on with the replace business. Good luck.

<div id="varTitle" style="display:none">
Film Title and Year
</div>

<input type="button" value="Feedback" onClick="popEmail()">

<Script language="JavaScript">
var divTitle = document.getElementById('varTitle').innerHTML;
var temp_email_subj = divTitle;
var toreplace=/"/g;
var email_subj = temp_email_subj.replace(toreplace, "''") + '%20(FTML%20record%20number%20AutoNumber)';
function popEmail()
{
location='mailto:user@address.org?subject=' + email_subj;
}
</script>
 
Posts: 69 | Location: Beverly Hills, California | Registered: Thu February 03 2005Reply With QuoteEdit or Delete MessageReport This Post
Posted Hide Post
thank you
 
Posts: 5 | Location: Eugene, OR, US | Registered: Wed June 25 2003Reply With QuoteEdit or Delete MessageReport This Post
and
Posted Hide Post
You can use regular expressions with replace so, for example, replace(/[^a-zA-Z]+/g,'') should remove everything except letters.

http://www.w3schools.com/jsref/jsref_replace.asp
http://en.wikipedia.org/wiki/Regular_expression
 
Posts: 3 | Registered: Wed April 01 2009Reply With QuoteEdit or Delete MessageReport This Post
  Powered by Eve Community  
 

www.Inmagic.com    Inmagic Forums    Inmagic Forums  Hop To Forum Categories  WebPublisher PRO    Email link and ampersand & character