Community Forums 

Main Content

HTML in message fields

    Sep 09 2010 18:40:51

    #1

    Ian S

    Join date : 2008-09-18      Posts : 154

    Hi,

    I would like to include a hyperlink in the shipping message box which will open a new browser window with some brief expalanations of the shipping bands we have (there just isn't enough space in the shipping message field at 255 characters).
    I have no idea how to do this.
    If the page to be opened is say http://www.mywebsite/shipping.htm, how would I put the link in the shipping message?

    Hope someone can help

    Thanks
    Ian



    Sep 09 2010 20:07:18

    #2

    anon

    Join date : 2008-09-18      Posts : 488

    Ian,

    You can add a hyperlink like:

    <a href='http://www.mywebsite.com/shipping.htm' target='_blank'>Shipping Information</a>

    You can get around the 255 char limit with a simple javascript. For example:
    <script type="text/javascript" src="http://www.mywebsite.com/js/cartmsg_ship.js"></script>;

    The script would look something like:
    var msg = '';
    msg += '<b>Line 1 of shipping message</b><br>';
    msg += 'Line 2 of shipping message<br>';
    msg += 'Line 3 of shipping message<br>';
    document.write(msg);

    One caveat, if the message will be displayed on a secure ssl page (name/address page if you have ssl turned on), the javascript should be on a secure server.



    Sep 09 2010 21:12:35

    #3

    Ian S

    Join date : 2008-09-18      Posts : 154

    Many thanks - I'll give it a go.

    Ian



    Sep 15 2010 21:36:56

    #4

    Ian S

    Join date : 2008-09-18      Posts : 154

    Hi Anon.

    HTML dunce requiring help again please.

    The Hyperlink is the way I'll go with this - but how does the code look if I want the page to open in a new window?

    Thanks

    Ian



    Sep 15 2010 22:19:49

    #5

    anon

    Join date : 2008-09-18      Posts : 488

    Including the target="_blank" parameter in the <a> tag (as I did in the example I provided) should open it in a new browser window.



    Sep 15 2010 22:52:55

    #6

    Ian S

    Join date : 2008-09-18      Posts : 154

    Many thanks

    Ian