Mandes, finaly got the right reaction though I can't understand why the title appears like I wrote a '\n' newline and the title is on the second line with a blank line above? Weird
Button Snipit that works?
PHP Code:
<button
name="buynow<?php echo $row['id'];?>"
id="buynow<?php echo $row['id'];?>"
class="button" onclick="addtoinvoice()" type="button"
title="
<?php
if($row['sold']=='Sold!')
echo $row['sold'];//returns on second line of title?
else
echo 'Buy Now!';//returns on second line of title?
?>
"/>
<?php
if($row['sold']=='Sold!')
echo $row['sold'];//returns good?
else
echo 'Buy Now!';//returns good?
?>
</button>
Hey, I noticed I'm not having the same responce with the onclick of the button? I'd probably have to change the className to avoid the JS responce. This is what I tried with the button onclick that doesn't seem to work even though I added the 'bought()' function to the JS.
Onclick Button Snipit
PHP Code:
<button
name="buynow<?php echo $row['id'];?>"
id="buynow<?php echo $row['id'];?>"
class="button"
onclick="//onclick
<?php
if($row['sold']=='Sold!')
echo 'addtoinvoice()';
else
echo 'bought()';
?>
"
type="button"
title="
<?php
if($row['sold']=='Sold!')
echo $row['sold'];
else
echo 'Buy Now!';
?>
"/>
<?php
if($row['sold']=='Sold!')
echo $row['sold'];
else
echo 'Buy Now!';
?>
</button>
Function bought
Code:
function bought()
{
alert('Congratulations! You purchased an original\nThere are no more of this item.');
}
Bookmarks