473,498 Members | 1,838 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Smiley Click picker using Javascript and FORM woes .. Please help...

OK im prety much a newbie at PHP but it has me hooked.

Im writing a comment system for one of our modules on phpnuke. Its all
going very well, well should i say WAS going very well :)

Ok all the comments work etc and everything is intergrated nicely in the
database. Now im parsing the comments back out to the user and replacing
string like :) with emoticons etc. It works perfectly and i'm seriously
pleased with myself (ok ok remember i said i was new at this :) .....

Now the issue i have is a silly one. I want to present the form input
for the comments in pretty much similair ways to phpbb does on a new
post. I.e present BBCODE icons and smileys that can be clicked and it
inserts into the FORM field ... I have a working javascript that does
just that but try as i might the darn thing will NOT wrap a FORM (even
if wrapping is on). This seems more a MOZILLA problem than IE ( wraps in
that). So if i keep on hitting the same icon again and again it will not
wrap and presents a scrollbar that keeps on going. The actual FORM will
wrap if i insert text inside it manually however so maybe its a
javascript error after all ??

Anyway im hoping someone somewhere can shed some light on this. Here the
test code.
-----------------------------------------------------------------------------
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="content-type">
<title></title>
</head>
<body>
<script type="text/javascript">
<!--
function addsmiley(code)
{
var pretext = document.comment.post.value;
this.code = code;
document.comment.post.value = pretext + code;
}
//-->
</script>
<b>Comment on this movie:</b>
<form name="comment" method="post" action="news.php"> <textarea
name="post" wrap="hard" rows="8" cols="30"></textarea></form>
<img src="../../forum/images/smiles/icon_biggrin.gif" alt=":)"
onclick="addsmiley(':)')" style="border: 0px solid ; width: 15px;
height: 15px; cursor: pointer;">
</body>
</html>
------------------------------------------------------------------------------
Ive tried setting WRAP to Virtual / HARD / SOFT / Physical etc and it
still insists on not wrapping from the javascript ... Anyone any ideas ???

Jul 23 '05 #1
3 3044
descds wrote:

<--snip-->
Ive tried setting WRAP to Virtual / HARD / SOFT / Physical etc and it
still insists on not wrapping from the javascript ... Anyone any ideas ???


Firefox (and I presume any other Geko-based browser) seems to only wrap if there's a space, it won't wrap between characters. Put a space before or after the smiley so that your onclick becomes:

onclick="addsmiley(':) ')"

Rob.
Jul 23 '05 #2
oh my i cant believe it was tha simple :) ive spent hours on this simple
thing and its just a space :) mYes works perfectly now. Can not thank
you enough .......

Thanks very much rob ... Finally i can put closure on something that i
assumed was going to be extremely simple :)

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 23 '05 #3
RobG wrote:
descds wrote:

<--snip-->
Ive tried setting WRAP to Virtual / HARD / SOFT / Physical etc and it
still insists on not wrapping from the javascript ... Anyone any ideas
???


Firefox (and I presume any other Geko-based browser) seems to only wrap
if there's a space, it won't wrap between characters. Put a space
before or after the smiley so that your onclick becomes:

onclick="addsmiley(':) ')"

Rob.


oh my i can't believe it was that simple :) i've spent hours on this
simple thing and its just a space :) Yes works perfectly now. Can not
thank you enough .......

Thanks very much rob ... Finally i can put closure on something that i
assumed was going to be extremely simple :)

Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1657
by: descds | last post by:
OK im prety much a newbie at PHP but it has me hooked. Im writing a comment system for one of our modules on phpnuke. Its all going very well, well should i say WAS going very well :) Ok all...
8
1999
by: George Hester | last post by:
In a page I have when the user left-clicks the page a Input box for a form gets the focus. But if the user right-clicks the page the Input box is not getting the focus. I'd like the Input box to...
13
3830
by: Hussein Patwa | last post by:
Hi there. I'm new to this group. I'm also partially sighted so navigating the web is sometimes quite difficult. I'm looking for a javascript date picker, you know the ones that travel sites...
1
2041
by: Simon | last post by:
Is there any way that I can use an input with type file as a directory picker? The input starts a file picker but I want to be able to select a folder rather than a file. Thanks IA, Simon
14
7158
by: Sinity | last post by:
Anyone knows the method/codes to disable the clicked button after first click by using .aspx-- to prevent people to click many time when waiting for the server response. I tried to do this by...
3
9124
by: DotNetGuy | last post by:
I have been programming in asp.net w/ vb for 3 years now and I feel a need to include more client side script with javascript so here I am. Hopefully in the right place. I have a timecard web app...
0
1655
by: obuli | last post by:
In VB.NET Form,i am using Date Time Picker How to fire "Date Time Picker" 's Click and "Double Click" events... It seems these events are not fired.. any one please help me .. thanks in...
1
4452
by: Sabbuser | last post by:
Hey Guys please help me out!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! I have placed a Date & Time Picker Control on a form in Windows 2000, When our Organization has upgraded all the PC's with...
4
4935
by: gggram2000 | last post by:
Hi, I'm using php 5.2.3 with mysql server 5.1 as backend. I have a program in which a person enters or chooses two dates from two datetime pickers and other info, I'm not sure if the problem is...
0
2174
by: =?Utf-8?B?a3BpenpsZQ==?= | last post by:
Hi all. using vs.net 9, C# I've got a trivial dilemma right now with my datetimepicker. It is bound to a datetime field in a database. This field is also set to not allow nulls. The default...
0
7125
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7167
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7208
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5464
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4593
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3095
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1423
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
292
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.