mam taki plik editor.js
Kod
var b = 2;
function tag(v, tagadd, newbut, tagclose, oldbut, name) {
if (eval(v)%2 == 0) {
eval("window.document.editform."+name+".value = newbut;");
var post = window.document.editform.strzelcy_d.value;
window.document.editform.strzelcy_d.value = post + tagadd;
window.document.editform.strzelcy_d.focus();
} else {
eval("window.document.editform."+name+".value = oldbut;");
var post = window.document.editform.strzelcy_d.value;
window.document.editform.strzelcy_d.value = post + tagclose;
window.document.editform.strzelcy_d.focus();
}
eval(v+"++;");
}
function tag(v, tagadd, newbut, tagclose, oldbut, name) {
if (eval(v)%2 == 0) {
eval("window.document.editform."+name+".value = newbut;");
var post = window.document.editform.strzelcy_d.value;
window.document.editform.strzelcy_d.value = post + tagadd;
window.document.editform.strzelcy_d.focus();
} else {
eval("window.document.editform."+name+".value = oldbut;");
var post = window.document.editform.strzelcy_d.value;
window.document.editform.strzelcy_d.value = post + tagclose;
window.document.editform.strzelcy_d.focus();
}
eval(v+"++;");
}
natomaist w pliku do edycji mam taki cos:
Kod
<div align=center><input type="button" value="BOLD" name="bold" onclick="javascript:tag('b','[b]','BOLD*','[/b]','BOLD','bold');" /></div>
[.......]
a tutaj sa formularze do edycji
[.......]
a tutaj sa formularze do edycji
i problem zaczyna sie tutaj, co zrobic, zeby ta funkcja javyscipta odnosila sie do OBYDWU formularzy



