Post by karyoker on Mar 12, 2006 20:05:42 GMT -8
Forum URL: karyoker.proboards27.com/index.cgi.proboards.com
I have tried this code
<script type='text/javascript'>
//Change message icon preview
//Do not redistribute this code without the creator's permission
//Created by CrAzY_J
var BaseUrl = 'http://cabaret-karaoke.com/images7/';
var ImageType = '.gif';
if( document.postForm )
{
document.postForm.icon.onchange = function()
{
document.images.iconImage.src = BaseUrl+document.postForm.icon.options[document.postForm.icon.selectedIndex].value+ImageType;
}
document.postForm.icon.onkeyup = function()
{
document.images.iconImage.src = BaseUrl+document.postForm.icon.options[document.postForm.icon.selectedIndex].value+ImageType;
}
}
</script>
When selecting the message icon it shows as the new one.. After posting it picks up some other in another folder on the host...
And this code which doesnt work at all
<script type="text/javascript">
// Change message icon preview
// Do not redistribute this code without the creator's permission
// Created by CrAzY_J and improved by Xargo
var cIcons = [
["smiley", "http://cabaret-karaoke.com/images7/smiley.gif"],
["standard", "http://cabaret-karaoke.com/images7/xx.gif"[/color]"] //The last one doesn't need a comma behind it.
];
if( document.postForm )
{
document.postForm.icon.onchange = function()
{
for (var i = 0; i<cIcons.length; i++)
{
if (document.postForm.icon.options[document.postForm.icon.selectedIndex].value == cIcons[0])
{
document.images.iconImage.src=cIcons[1];
break;
}
if (i == cIcons.length-1)
{
document.images.iconImage.src='http://www.proboards.com/v4images/'+document.postForm.icon.options[document.postForm.icon.selectedIndex].value+'.gif';
}
}
}
document.postForm.icon.onkeyup = function()
{
for (var i = 0; i<cIcons.length; i++)
{
if (document.postForm.icon.options[document.postForm.icon.selectedIndex].value == cIcons[0])
{
document.images.iconImage.src=cIcons[1];
break;
}
if (i == cIcons.length-1)
{
document.images.iconImage.src='http://www.proboards.com/v4images/'+document.postForm.icon.options[document.postForm.icon.selectedIndex].value+'.gif';
}
}
}
}
</script>
What am I doing wrong?
I have tried this code
<script type='text/javascript'>
//Change message icon preview
//Do not redistribute this code without the creator's permission
//Created by CrAzY_J
var BaseUrl = 'http://cabaret-karaoke.com/images7/';
var ImageType = '.gif';
if( document.postForm )
{
document.postForm.icon.onchange = function()
{
document.images.iconImage.src = BaseUrl+document.postForm.icon.options[document.postForm.icon.selectedIndex].value+ImageType;
}
document.postForm.icon.onkeyup = function()
{
document.images.iconImage.src = BaseUrl+document.postForm.icon.options[document.postForm.icon.selectedIndex].value+ImageType;
}
}
</script>
When selecting the message icon it shows as the new one.. After posting it picks up some other in another folder on the host...
And this code which doesnt work at all
<script type="text/javascript">
// Change message icon preview
// Do not redistribute this code without the creator's permission
// Created by CrAzY_J and improved by Xargo
var cIcons = [
["smiley", "http://cabaret-karaoke.com/images7/smiley.gif"],
["standard", "http://cabaret-karaoke.com/images7/xx.gif"[/color]"] //The last one doesn't need a comma behind it.
];
if( document.postForm )
{
document.postForm.icon.onchange = function()
{
for (var i = 0; i<cIcons.length; i++)
{
if (document.postForm.icon.options[document.postForm.icon.selectedIndex].value == cIcons[0])
{
document.images.iconImage.src=cIcons[1];
break;
}
if (i == cIcons.length-1)
{
document.images.iconImage.src='http://www.proboards.com/v4images/'+document.postForm.icon.options[document.postForm.icon.selectedIndex].value+'.gif';
}
}
}
document.postForm.icon.onkeyup = function()
{
for (var i = 0; i<cIcons.length; i++)
{
if (document.postForm.icon.options[document.postForm.icon.selectedIndex].value == cIcons[0])
{
document.images.iconImage.src=cIcons[1];
break;
}
if (i == cIcons.length-1)
{
document.images.iconImage.src='http://www.proboards.com/v4images/'+document.postForm.icon.options[document.postForm.icon.selectedIndex].value+'.gif';
}
}
}
}
</script>
What am I doing wrong?