Click to See Complete Forum and Search --> : A question


Zach Elfers
11-20-2002, 12:15 PM
I am making an HTML Builder. I want a thing where the visitor selects some text and is then able to apply HTML formatting to it. There would be buttons like B, I, U, Center, etc. Similar to this forum. I am making a script for it right now, but it's not working. Please help! Thanx.

<script languge="JavaScript">

function ChangeTxt(form) {
var txt="";
txt+="";
if (form.text.value) {
txt+="<b>" + form.text.select() + "<\/b>";
}
else {
txt+="";
}
form.text.value=txt;
}

</script>

<form>
<textarea cols="65" rows="10"></textarea>
<br>
<center><input type="button" value="Change" onClick="ChangeTxt(this.form);"></center>
</form>

Ryan
11-20-2002, 01:51 PM
well, if you cut and pasted your script, the problem is this:

<script languge="JavaScript">

one: language is spelled wrong.
two: the "type" attribute should be used instead.

<script type="text/javascript">

Happy Coding.

Zach Elfers
11-20-2002, 09:40 PM
I just typed that now. I didn't cut and paste the script. What do you mean by type? Can somebody please rewrite the script for me? Thanx.:confused: :)