Witam ponownie - tamten kod nie chciał działać więc znalazłem następny, który działa mniej więcej, mam z nim problem
Kod
<script type="text/javascript">
function ifEnter(field,event) {
var theCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
if (theCode == 13){
document.forms[0].submit();
return false;
}
else
return true;
}
</script>
<table border="0" cellspacing="1" cellpadding="4" class="tborder">
<thead>
<tr>
<td class="thead" colspan="6">
<div class="expcolimage"><img src="{$theme['imgdir']}/collapse.gif" id="shoutbox_img" class="expander" alt="Zwiń/Rozwiń forum PGC, PGC, Najlepsze serwery, nonsteam, Najlepsze serwery CS 1.6, CS 1.6, poradniki, pomoc, HLDS, PGC-CS, steam, forum" title="[-]" /></div>
<div><strong>{$lang->sf_sb_shoutbox}</strong> (<a rel="nofollow" title="PGC zobacz ShouBox w pełnym rozmiarze" href="index.php?action=full_shoutbox">{$lang->sf_sb_fullsbox}</a>) <font size="1"> - ShoutBox służy do luźnej rozmowy, masz problem? Użyj <a rel="nofollow" href="http://pgc-cs.eu/search2.php" title="Wyszukiwarka PGC"> wyszukiwarki</a>, jeśli nie znajdziesz odpowiedzi załóż nowy temat</font><br /></div>
</td>
</tr>
</thead>
<tbody id="shoutbox_e">
<tr>
<td class="trow1" colspan="2"><div id="shoutbox_data" style="height: {$mybb->settings[sf_sb_height]}px; overflow: auto;"><img width="150" height="10" src="./img/icons/ajax-loader.gif" alt="Ładowanie stausów serwerów..." /><br />{$lang->sf_sb_loading}</div></td>
</tr>
<tr>
<td class="trow2">
{$smiles_sb}
</td>
<td class="trow2" align="center">
<form onsubmit="ShoutBox.postShout(); $('shout_data').value = ''; return false;" action="" name=f >
<textarea onkeypress="ifEnter(this,event);" id="shout_data" rows="0,5" cols="100" name=t onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onchange="storeCaret(this);"></textarea>
<input type="submit" value="{$lang->sf_sb_shoutnow}" id="shouting-status" /></td>
</tr>
</tbody>
</table>
<br />
<script type="text/javascript">
ShoutBox.refreshInterval = {$mybb->settings[sf_sb_refresh_interval]};
ShoutBox.MaxEntries = {$mybb->settings[sf_sb_shouts_main]};
ShoutBox.lang = ['{$lang->sf_sb_posting}', '{$lang->sf_sb_shoutnow}', '{$lang->sf_sb_loading}'];
{$extra_js}
Event.observe(window, 'load', ShoutBox.showShouts);
</script>
Gdy zamienię z tego:
Kod
if (theCode == 13){
document.forms[0].submit();
return false;
}
na to:
Kod
if (theCode == 13){
formObj.action='shouting-status';
document.forms[0].submit();
return false;
}
Wtedy przestaje działać, coś źle zrobiłem - dodam, że nie znam języka JS więc trudno mi cokolwiek samemu naprawić.
Pozdrawiam