Jump to content

OnLoad to textarea/textfild... Help?!


Kristian_C

Recommended Posts

Hey, anyone here that knows where i can find a code for onload just like in the forums here, click on a smily and it comes into the textarea. i had a script onetime but it was to wird for me, the smilies and the textarea had to be inside the table. need it for bbcodes, contact lists ++ so if someone knows how to code it or where i chould find a code i whould be verry happy :)

Link to comment
Share on other sites

Here is what i have now :

<script language="javascript" type="text/javascript">function AddEmoticon1(text) {	var input = document.form.to;	text = ' ' + text + ' ';	if (input.createTextRange && input.caretPos) {		var caretPos = input.caretPos;		caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? caretPos.text + text + ' ' : caretPos.text + text;		input.focus();	} else {		input.value  += text;		input.focus();	}}</script><style type="text/css"><!--.style1 {color: cc000}--></style><form name="form" method="post" action="">	<tr> 	  <td width="51%" height="41"> </td>	  <td> </td>	</tr>  <table width="69%" border="0" align="center" cellpadding="0" cellspacing="2" >	<!--DWLayoutTable-->	<tr> 	  <td height="19" valign="top"><table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="black" class=thinline>		  <!--DWLayoutTable-->		  <tr>			<td height="17" colspan="4" background="includes/grad.jpg"><div align="center"><strong>Send Message </strong></div></td>		  </tr>		  <tr bgcolor="#666666">			<td background="includes/grad.jpg" colspan="3"><div align="center"><strong>Send To </strong></div></td>			<td background="includes/grad.jpg"><div align="center"><strong>Title</strong></div></td>		  </tr>		  <tr bgcolor="#666666"> 			<td colspan="3"><div align="center"></div>			  <div align="center">				<input type=text name=to class=submit style=width: font-weight: bold; 60%; value='<?php echo $fromper; ?>'>			  </div></td>			<td width="50%"><div align="center"></div>			  <div align="center">				<input name=title type=text class=style1 id="title" style=width: value="None" maxlength="20" font-weight: bold; 60%;>			  </div></td>		  </tr>		  <tr bgcolor="#666666">			<td  height="5" colspan="4"><strong>Message:		  </strong>		  </tr>		  <tr bgcolor="#666666"> 			<td width="8%"  height="5">			<a href="java script:AddEmoticon('[b]TEXT[/b]')"><b>BOLD</b></a> <br>			<a href="java script:AddEmoticon('[i]TEXT[/i]')"><i>ITALIC</i></a><br>			<a href="java script:AddEmoticon('[u]TEXT[/u]')"><u>ULINE</u></a><br>			<a href="java script:AddEmoticon('[i][b]TEXT[/b][/i]')"><u><b>MIXED</b></u></a><br>			<a href="java script:AddEmoticon('[i][b]TEXT[/b][/i]')"><i><b>MIXED2</b></i></a><br>			<a href="java script:AddEmoticon('[red]TEXT[/red]')" class="style1">RED</a> <br>			<a href="java script:AddEmoticon('[green]TEXT[/green]')" class="style1">GREEN</a> <br>			<a href="java script:AddEmoticon('[blue]TEXT[/blue]')" class="style1">BLUE</a> <br>			<a href="java script:AddEmoticon(':bank:')" class="style1"><img src="emotions/chair.gif" border="0"></a><br>			<a href="java script:AddEmoticon(':cheers:')" class="style1"><img src="emotions/cheers.gif" border="0"></a><br>		 			<td colspan="3" > <textarea name='text' id="textarea" cols="100"  class=submit style='width: 98%; height: 175px; font-weight: bold;'><?php if ($m > 0){ echo "[b]On:[/b] $dateon.  $fromper [b] Wrote:[/b] $ini"; }else{ } ?></textarea></td>		  </tr>		  <tr bgcolor="#666666"> 			<td  height="5"> </td>			<td colspan="3"><div align="center">			  <input type=submit name=Send value=Send class=submit>			</div></td>		  </tr>		</table></td>	</tr>  </table></form>

Some one knows how i can get it in seperate tables?

Link to comment
Share on other sites

Managed to use get as usual to get from contact list :) but still cant do it with bbcode onload....

	  <?	  if($_GET[test]);	  $code=($_GET[test]);	  ?><table width="18%" height="27"  border="1" align="center" cellspacing="1">  <tr>	<th height="23" scope="col"><a href="?test=Admin">Admin</a></th>  </tr></table><p> </p><table width="32%"  border="1" align="center" cellspacing="1">  <tr>	<th height="125" colspan="2" scope="col"><form name="form1" method="post" action="">	  <textarea name="textarea" cols="60" rows="5"><? echo"$code"; ?>	  </textarea>	</form></th>  </tr></table>

Simple way :) hehe

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...