Jump to content

Lulzim

Members
  • Posts

    295
  • Joined

  • Last visited

Posts posted by Lulzim

  1. forget the first one, this is betterhere is an example with 2 textareas

    <html><head><script type='text/javascript'>function addBB (text, target){	document.getElementById(target).value+=text;}</script></head><body><form action="somefile.php" id="form1"><input type='button' value='Italic' onclick="addBB('[i]ITALIC_TEXT[/i] ', 'txt');"><input type='button' value='bold' onclick="addBB('[b]BOLD_TEXT[/b] ', 'txt');"><input type='button' value='underline' onclick="addBB('[u]UNDERLINE_TEXT[/u] ', 'txt');"><input type='button' value='url' onclick="addBB('[url=URL_TO_GO_TO]TEXT_DISPLAYED[/url] ', 'txt');"><input type='button' value='color' onclick="addBB('[color=COLOR_YOU_WANT]COLORED_TEXT[/color] ', 'txt');"><input type='button' value='image' onclick="addBB('[img=IMAGE_PATH] ', 'txt');"><input type='button' value='align' onclick="addBB('[align=LEFT/RIGHT/CENTER]CONTENT_TO_BE_ALIGNED[/align] ', 'txt');"><br><textarea cols='80' rows='10' id='txt' name='txt'></textarea><br> <br><input type='button' value='Italic' onclick="addBB('[i]ITALIC_TEXT[/i] ', 'txt2');"><input type='button' value='bold' onclick="addBB('[b]BOLD_TEXT[/b] ', 'txt2');"><input type='button' value='underline' onclick="addBB('[u]UNDERLINE_TEXT[/u] ', 'txt2');"><input type='button' value='url' onclick="addBB('[url=URL_TO_GO_TO]TEXT_DISPLAYED[/url] ', 'txt2');"><input type='button' value='color' onclick="addBB('[color=COLOR_YOU_WANT]COLORED_TEXT[/color] ', 'txt2');"><input type='button' value='image' onclick="addBB('[img=IMAGE_PATH] ', 'txt2');"><input type='button' value='align' onclick="addBB('[align=LEFT/RIGHT/CENTER]CONTENT_TO_BE_ALIGNED[/align] ', 'txt2');"><br><textarea cols='80' rows='10' id='txt2' name='txt'></textarea><br><input type='submit' value='save'></form></body></html>

    when you call the addBB function, the first argument is the text which you want to add when button is clicked and the second argument is the target textarealike this:addBB('text_to_display', 'target_textarea')you can add as much textareas you want :)btw. this doesn't have anything to do with php, somebody move this thread to javascript forum

  2. here is a very simple one

    <html><head></head><body><form action="somefile.php"><input type='button' value='Italic' onclick="txt.value+='[i]ITALIC_TEXT[/i] ';"><input type='button' value='bold' onclick="txt.value+='[b]BOLD_TEXT[/b] ';"><input type='button' value='underline' onclick="txt.value+='[u]UNDERLINE_TEXT[/u] ';"><input type='button' value='url' onclick="txt.value+='[url=URL_TO_GO_TO]TEXT_DISPLAYED[/url] ';"><input type='button' value='color' onclick="txt.value+='[color=COLOR_YOU_WANT]COLORED_TEXT[/color] ';"><input type='button' value='image' onclick="txt.value+='[img=IMAGE_PATH] ';"><input type='button' value='align' onclick="txt.value+='[align=LEFT/RIGHT/CENTER]CONTENT_TO_BE_ALIGNED[/align] ';"><br><textarea cols='100' rows='10' id='txt' name='txt'></textarea><br><input type='submit' value='save'></form></body></html>

  3. this one works fine:

    <html><head><title>test page</title><script type='text/javascript'>function addText(){	var myArray = new Array("Sam","Pete");	document.getElementById("addTextHere").innerHTML += "Posted By "+myArray[0];}</script></head><body><input type='button' value='click me' onclick="addText();"><br><br><div id='addTextHere'>InnerHTML text goes here: </div></body></html>

  4. <?php  if ($row_RSsales['website'] == '')  {  echo '<a href="'	 . $row_RSsales['website']	 . '" target="_blank">'	 . $row_RSsales['name']	 . '</a>';  }  else  {  echo $row_RSsales['name'];  }?>

    that should do it.love,jason

    you changed the condition here from != to == :
    if ($row_RSsales['website'] == '')

    it should be like this:

    if ($row_RSsales['website'] != '')

×
×
  • Create New...