Gumbo
Erfahrenes Mitglied
Umständlich, machs doch so:
Code:
<script type="text/javascript" language="javascript">
function Farbe()
{
var svalue = document.Formular.Font.options[document.Formular.Font.selectedIndex].text.toUpperCase();
if(document.Formular.Font.options[document.Formular.Font.selectedIndex].value != "0")
{
var text = prompt("Schreibe dein Text, der "+ svalue +" erscheinen soll!","");
if(text != "")
{
text = "["+ svalue +"]"+ text +"[/"+ svalue +"]";
document.Formular.textarea.value += text;
}
}
}
function Groesse()
{
var svalue = document.Formular.Size.options[document.Formular.Size.selectedIndex].text.toUpperCase();
if(document.Formular.Size.options[document.Formular.Size.selectedIndex].value != "0")
{
var text = prompt("Schreibe dein Text, der "+ svalue +" erscheinen soll!","");
if(text != "")
{
text = "["+ svalue +"]"+ text +"[/"+ svalue +"]";
document.Formular.textarea.value += text;
}
}
}
</script>
</header>
<body>
<form name="Formular">
<select onChange="Farbe()" name="Font">
<option value="0">FARBE</option>
<option value="" style="color:orange">Orange</font></option>
<option value="" style="color:red">Rot</option>
<option value="" style="color:blue">Blau</option>
<option value="" style="color:green">Grün</option>
<option value="" style="color:silver">Silber</option>
</select>
<select onChange="Groesse()" name="Size">
<option value="0">GRÖSSE</option>
<option value="">klein</font></option>
<option value="">gross</option>
<option value="">riesig</option>
</select>
<br>
<textarea name="textarea"></textarea>
</form>