|
Go
![]() |
New
![]() |
Find
![]() |
Notify
![]() |
Tools
![]() |
Reply
![]() |
|
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.
|
|||
|
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 |
||||
|
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> |
||||
|
thank you
|
||||
|
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 |
||||
|
| Powered by Eve Community |
| Please Wait. Your request is being processed... |
|

