By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,067 Members | 1,818 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,067 IT Pros & Developers. It's quick & easy.

New Line Help Needed

P: n/a
I'm trying to insert a newline character into the string below for an
<INPUT TYPE="image" ALT= tag but when I hold the mouse over the image
I see the string but without a newline break in the string - how do I
get the line to break?

$php_floating_tip = "Member Name: $php_row2->displayed_member_name
\\nPersonality Ranking: $php_row2->ranking"
Thanks...

Jul 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Ralph Freshour wrote:
I'm trying to insert a newline character into the string below for an
<INPUT TYPE="image" ALT= tag but when I hold the mouse over the image
I see the string but without a newline break in the string - how do I
get the line to break?

$php_floating_tip = "Member Name: $php_row2->displayed_member_name
\\nPersonality Ranking: $php_row2->ranking"
Thanks...


"use the source, Luke."

you'll see that the line break is really there but the browser is
ignoring it when rendering the tooltip.

Jul 17 '05 #2

P: n/a
Terence wrote:
Ralph Freshour wrote:
I'm trying to insert a newline character into the string below for an
<INPUT TYPE="image" ALT= tag but when I hold the mouse over the image
I see the string but without a newline break in the string - how do I
get the line to break?

$php_floating_tip = "Member Name: $php_row2->displayed_member_name
\\nPersonality Ranking: $php_row2->ranking"
Thanks...


"use the source, Luke."

you'll see that the line break is really there but the browser is
ignoring it when rendering the tooltip.


you really want overlib

http://www.bosrup.com/web/overlib/

if you are generating javascript string literals from PHP, be sure to
escape the strings.

replace ' with '' if inside single quotes
and " with "" if inside double quotes

Might be an idea to use PHP to generate a JS array containing all your
quotes (string literals) and then use the array throughout the HTML
otherwise things can get very yucky indeed.
$strJs = "arrQuotes = {";
foreach($arrQuotes AS $key => $quote) {
$strJs .= $key.":'".str_replace("'","''",$quote)."',";
}
$strJs .= "};\n";

also, considder using
<script language="JavaScript" src="quote_js.php"
type="text/javascript"></script>

where the js soruce file is actually a PHP script.
Jul 17 '05 #3

P: n/a
*** Ralph Freshour wrote/escribió (Wed, 19 Nov 2003 05:07:57 GMT):
I'm trying to insert a newline character into the string below for an
<INPUT TYPE="image" ALT= tag but when I hold the mouse over the image
I see the string but without a newline break in the string - how do I
get the line to break?


The purpose of ALT tag is providing an alternative text for cases in which
image is *not* shown. For tooltips you have to use TITLE tag. However, the
way TITLE info is shown depends on browser so there is normally no way of
formatting that text. Try overlib as suggested by Terence.

--
--
-- Álvaro G. Vicario - Burgos, Spain
--
Jul 17 '05 #4

P: n/a
"Ralph Freshour" <ra***@primemail.com> wrote in message
news:hg********************************@4ax.com...
I'm trying to insert a newline character into the string below for an
<INPUT TYPE="image" ALT= tag but when I hold the mouse over the image
I see the string but without a newline break in the string - how do I
get the line to break?


Try substituting the entity --

Netscape will ignore it though... possibly other browsers too.
Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.