Hi,
First I would like to thank everybody who takes the time to read and reply to messages on this forum, you really do help!
I have a limited knowledge of javascript but have managed to write a stock message script with help from this forum, however I would like to add different colours dependent on the returned text can anybody help?
I have the following script
<SCRIPT LANGUAGE="JavaScript" Type="text/javascript">
function StockLevels (pItem)
<!--
{
var strIDs = 'Stock Message: '
{
if (pItem >= 5)
{
strIDs = 'In Stock - Usually ships in 1-2 days'
}
else if (pItem <= 4 && pItem >= 1)
{
strIDs = 'In Stock - Usually ships in 4-5 days'
}
else if (pItem <= 0)
{
strIDs = 'On Order - Usually ships in 10-14 days'
}
else
{
strIDs = 'Unable to verify stock quantities'
}
}
return strIDs
}
//-->
</script>
I would like each return text to be a different colour i.e Green, Orange and Red, so that users can see instantly the stock levels.
Any help would be apreciated.
Thanks
Steven
http://www.wallplates.co.uk
First I would like to thank everybody who takes the time to read and reply to messages on this forum, you really do help!
I have a limited knowledge of javascript but have managed to write a stock message script with help from this forum, however I would like to add different colours dependent on the returned text can anybody help?
I have the following script
<SCRIPT LANGUAGE="JavaScript" Type="text/javascript">
function StockLevels (pItem)
<!--
{
var strIDs = 'Stock Message: '
{
if (pItem >= 5)
{
strIDs = 'In Stock - Usually ships in 1-2 days'
}
else if (pItem <= 4 && pItem >= 1)
{
strIDs = 'In Stock - Usually ships in 4-5 days'
}
else if (pItem <= 0)
{
strIDs = 'On Order - Usually ships in 10-14 days'
}
else
{
strIDs = 'Unable to verify stock quantities'
}
}
return strIDs
}
//-->
</script>
I would like each return text to be a different colour i.e Green, Orange and Red, so that users can see instantly the stock levels.
Any help would be apreciated.
Thanks
Steven
http://www.wallplates.co.uk
Comment