I made a 'bbcode inserter' for my comment form, it is basically a select box that brings up a prompt asking about what you want in the bbcode, there wasn't much scripts out there for this 'simplcilty' (consider that the website is quite limtited to space) so I decided that I would make my own and it was ment to be 'finished' but there always seems to be a error with it, and I did fix some would-be errors but I have not managed to get this error.
to produce this error: click on the dropdown menu 'bbcode' as it has a onchange value.
URL: http://scaryghosts.org/comment.php
'BBCODE Inserter' Script Code
The error line (also the dropdown menu)Code:<script type="text/javascript"> function insertbbcode(bbcalled) { var commentform = document.getElementById("submitcomment"); if(bbcalled == 'b'){ var promdata=prompt("Please enter the text you wish to be bold,",""); if(promdata != ""){commentform.message.value=commentform.message.value+""+promdata+""} } ifelse(bbcalled == 'i'){ var promdata=prompt("Please enter the text you wish to be italic.",""); if(promdata != ""){commentform.message.value=commentform.message.value+""+promdata+""} } ifelse(bbcalled == 'u'){ var promdata=prompt("Please enter the text you wish to be underlined.",""); if(promdata != ""){commentform.message.value=commentform.message.value+""+promdata+""} } ifelse(bbcalled == 's'){ var promdata=prompt("Please enter the text you wish to be striked out.",""); if(promdata != ""){commentform.message.value=commentform.message.value+"[s]"+promdata+"[/s]"} } ifelse(bbcalled == 'o'){ var promdata=prompt("Please enter the text you wish to be overlined.",""); if(promdata != ""){commentform.message.value=commentform.message.value+"[o]"+promdata+"[/o]"} } ifelse(bbcalled == 'col'){ var colordata=prompt("Please enter the color you wish your text to be (EG red).",""); var promdata=prompt("Please enter the text you wish to see colored.",""); if(promdata != "" || colordata != "" ){commentform.message.value=commentform.message.value+"[color="+colordata+"]"+promdata+"[/color]"} } ifelse(bbcalled == 'siz'){ var sizedata=prompt("Please enter the size you wish your text to be (EG 10).",""); var promdata=prompt("Please enter the text you wish to see sized.",""); if(promdata != "" || sizedata != "" ){commentform.message.value=commentform.message.value+"[size="+sizedata+"]"+promdata+"[/size]"} } ifelse(bbcalled == 'font'){ var fontdata=prompt("Please enter the font you wish your text to be (EG Times New Roman).",""); var promdata=prompt("Please enter the text you wish to see with the font.",""); if(promdata != "" || fontdata != "" ){commentform.message.value=commentform.message.value+""+promdata+""} } ifelse(bbcalled == 'img'){ var promdata=prompt("Please enter the URL of the image you wish to be displayed (EG http://www.webiste.com/image.gif).",""); if(promdata != ""){commentform.message.value=commentform.message.value+"[img]"+promdata+"[/img]"} } ifelse(bbcalled == 'url'){ var promdata=prompt("Please enter the URL you wish to be displayed (EG http://www.webiste.com/).",""); if(promdata != ""){commentform.message.value=commentform.message.value+""+promdata+""} } ifelse(bbcalled == 'mail'){ var promdata=prompt("Please enter the email you wish to be displayed (EG me@hotmail.co.uk).",""); if(promdata != ""){commentform.message.value=commentform.message.value+"[mail]"+promdata+"[/mail]"} } } </script>
For anybody that helps me I give them a big:Code:ERROR LINE: <select style="margin-top:5px;border: 1px solid #000;font-family:Shruti;font-size:11px;padding-left:1px;" name="bbcode" onchange="insertbbcode(this.options[selectedIndex].value);this.selectedIndex=0;"> <option selected="selected" value="">BBCode</option> <option value="b">Bold</option> <option value="i">Italic</option> <option value="u">Underlined</option> <option value="s">Strikethrough</option> <option value="o">Overlined</option> <option value"col">Colored Text</option> <option value"siz">Sized Text</option> <option value="font">Font</option> <option value="img">Image</option> <option value="url">URL</option> <option value="mail">Email</option> </select>![]()



Reply With Quote

Bookmarks