Jump to content


javascript, bbcode, put value into form


4 replies to this topic

#1 derek.sullivan

    Jedi In Training

  • Members
  • PipPip
  • 341 posts
  • Gender:Male
  • Location:Georgia
  • Interests:preaching, programming, music, friends, outdoors, moves, books

Posted 02 July 2008 - 01:04 AM

function InsertBBCode(what) {
var form = document.newtopic.body;
var what;
if (what == "code") {
form.value += "[ code ][ /code ]";
}
if (what == "bold") {
form.value += "[b] [/b]";
}	
if (what == "underline") {
form.value += "[u] [/u]";
}	
if (what == "italic") {		
form.value += "[i] [/i]";
}
if (what == "url") {	
form.value += "[url="http://"] [/url]";
}
if (what == "img") {
form.value += "[img= ] [/img]";
}
}

when you click one of the buttons, it wont insert the value into the textarea that is specified. The form id, name is correct, the textarea name is correct just cannot figure out why it wont work am i missing someting?

Edited by bigdfbc2008, 02 July 2008 - 01:05 AM.


#2 derek.sullivan

    Jedi In Training

  • Members
  • PipPip
  • 341 posts
  • Gender:Male
  • Location:Georgia
  • Interests:preaching, programming, music, friends, outdoors, moves, books

Posted 02 July 2008 - 01:46 AM

solved it.

#3 Trevsweb

    Young Padawan

  • Members
  • Pip
  • 83 posts
  • Gender:Male
  • Location:London, UK
  • Interests:the usual GFX and coding

Posted 03 July 2008 - 02:26 PM

i had a similer problem.
http://www.pixel2life.com/forums/index.php...c=40970&hl=

Edited by Trevsweb, 03 July 2008 - 02:28 PM.


#4 adam12345

    Young Padawan

  • Members
  • Pip
  • 17 posts

Posted 29 July 2008 - 07:51 AM

Guys look at this tut:

Removed: No site plugging ~rc

Edited by rc69, 29 July 2008 - 12:05 PM.


#5 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 29 July 2008 - 12:04 PM

This topic has be solved, no further replies are necessary.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users