I am trying to make a JS Script that does similar stuff to the vBCode in forums. I have problems with adding it in to the text box. It says the txt is undefined.
I tried more things like it:
document.forms.txt
document.all.txt
but it gives the same error everywhere. This is my code:
[code=php]
<!– CODE FUNCTION –>
<script>
<!–
function code(tag){
if (tag = “b”) {
document.forms.txt.value = document.forms.txt.value & “<b></b>”;
}
if (tag = “a”) {
//Not changed yet
//txt.text = txt.text & “<a href=””></a>”;
}
………….
}
–>
</script>
<!– END CODE FUNCTION –>
Also, can you use ” in JS and HTML too?
How do I get to the text box?
Is it different with text boxes that have multiple lines? I use it with one with 1 line and it works simply.