473,372 Members | 1,229 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,372 software developers and data experts.

textarea problem

say i have a form where, if a user clicks in it, all the text is
highlighted, and where, if a user clicks on a button outside of the
form, a certain text string is inserted where the cursor in the
textarea is. why is it, then, that when i, immediatly after loading
the page, click in the textarea, highlighting the text, click again in
the middle of the text (effectively unhighlighting everything, as
well), and then click on the button to insert to the text, the text
string that is to be inserted appears outside of the form?

here's a working demonstration:

http://www.geocities.com/terra1024/error-forms.html

if you click right before the first and only capatilized T twice, and
then click on the ### link underneath the text area, ### is not
inserted into the form, as i would like, but is rather inserted
outside of the form.

if i comment out the function that is responsible for the
highlighting, it works just fine, although i can't see, for the life
of me, what in the highlighting function is causing this...

any help would be appreciated - thanks! :)
Jul 23 '05 #1
5 2611
On 14 Jun 2004 20:05:28 -0700, yawnmoth wrote:
http://www.geocities.com/terra1024/error-forms.html


You might check into this first..
<http://validator.w3.org/check?uri=http://www.geocities.com/terra1024/error-forms.html&charset=utf-8&doctype=HTML+4.01+Transitional>
Particularly errors 5 though 13, which
mention unmatched tags or similar..

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
Jul 23 '05 #2
On Tue, 15 Jun 2004 07:44:07 GMT, Andrew Thompson
<Se********@www.invalid> wrote:
On 14 Jun 2004 20:05:28 -0700, yawnmoth wrote:
http://www.geocities.com/terra1024/error-forms.html


You might check into this first..
<http://validator.w3.org/check?uri=http://www.geocities.com/terra1024/error-forms.html&charset=utf-8&doctype=HTML+4.01+Transitional>
Particularly errors 5 though 13, which
mention unmatched tags or similar..


all errors after, and including, 5 deal with the geocities code
addition for ad placement, and as such, there's not really a whole lot
i can do about that :(
Jul 23 '05 #3
On Tue, 15 Jun 2004 17:09:03 GMT, yawnmoth wrote:
On Tue, 15 Jun 2004 07:44:07 GMT, Andrew Thompson wrote:
On 14 Jun 2004 20:05:28 -0700, yawnmoth wrote:
http://www.geocities.com/terra1024/error-forms.html
You might check into this first..
<http://validator.w3.org/check?uri=http://www.geocities.com/terra1024/error-forms.html&charset=utf-8&doctype=HTML+4.01+Transitional>

.... all errors after, and including, 5 deal with the geocities code
addition for ad placement,
Well, ain't that a mongrel. I just confirmed
what you said against a friends page that I'd
validated just before uploading to GeoCities.

Full of the same type of errors your page
is showing..

My apologies for any suggestion you had not
done all you might to solve the problem.

[ I have a documnet recommending folks put a
page up for applet/JS/HTML/CSS problems..
but the mangling by GeoCities does not help
much when debugging any of the above ]
...and as such, there's not really a whole lot
i can do about that :(


....hmmmm. I still wonder if that is a factor
though, the HTML becomes pretty mangled.
Perhaps one of the JS gurus who has more
experience with this situation might
clarify if it could be a factor.

Does it work as you expect on your home PC?

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
Jul 23 '05 #4
On Tue, 15 Jun 2004 19:10:08 GMT, Andrew Thompson
<Se********@www.invalid> wrote:
On Tue, 15 Jun 2004 17:09:03 GMT, yawnmoth wrote:
On Tue, 15 Jun 2004 07:44:07 GMT, Andrew Thompson wrote:
On 14 Jun 2004 20:05:28 -0700, yawnmoth wrote:

http://www.geocities.com/terra1024/error-forms.html

You might check into this first..
<http://validator.w3.org/check?uri=http://www.geocities.com/terra1024/error-forms.html&charset=utf-8&doctype=HTML+4.01+Transitional>

...
all errors after, and including, 5 deal with the geocities code
addition for ad placement,


Well, ain't that a mongrel. I just confirmed
what you said against a friends page that I'd
validated just before uploading to GeoCities.

Full of the same type of errors your page
is showing..

My apologies for any suggestion you had not
done all you might to solve the problem.

[ I have a documnet recommending folks put a
page up for applet/JS/HTML/CSS problems..
but the mangling by GeoCities does not help
much when debugging any of the above ]
...and as such, there's not really a whole lot
i can do about that :(


...hmmmm. I still wonder if that is a factor
though, the HTML becomes pretty mangled.
Perhaps one of the JS gurus who has more
experience with this situation might
clarify if it could be a factor.

Does it work as you expect on your home PC?


sadly, no :(

Jul 23 '05 #5
On 14 Jun 2004 20:05:28 -0700, te*******@yahoo.com (yawnmoth) wrote:
say i have a form where, if a user clicks in it, all the text is
highlighted, and where, if a user clicks on a button outside of the
form, a certain text string is inserted where the cursor in the
textarea is. why is it, then, that when i, immediatly after loading
the page, click in the textarea, highlighting the text, click again in
the middle of the text (effectively unhighlighting everything, as
well), and then click on the button to insert to the text, the text
string that is to be inserted appears outside of the form?

here's a working demonstration:

http://www.geocities.com/terra1024/error-forms.html

if you click right before the first and only capatilized T twice, and
then click on the ### link underneath the text area, ### is not
inserted into the form, as i would like, but is rather inserted
outside of the form.

if i comment out the function that is responsible for the
highlighting, it works just fine, although i can't see, for the life
of me, what in the highlighting function is causing this...

any help would be appreciated - thanks! :)


as a followup to this post, i've figured out a few things. the code
on the previously linked to html document was from phpBB. so, if you
highlight text in either, select within the highlighted text, and try
to insert some text (or a smiley in the case of phpBB), it'll be
instead inserted at the top of the page. so the problem isn't with my
use of a function to highlight text.

vBulletin (another message board software package) fixes this problem,
but in doing so, introduces another. when you click in a textarea,
and then click outside of it (without clicking on a link that would
insert something), and you then try to insert something, it'll be
inserted at the begining - not where the cursor previously was before
you selected outside of the textarea.

phpBB's approach has the so-called claret position being determined
via onClick, onKeyup triggers, whereas vBB determines it by
determining the current location when you immediatly try to insert
something.

in an attempt to get the best of both, i've added code that should
make the assumed claret position be the position determined by the
onClick, etc, triggers, unless the position that those triggers would
insert is outside of the bounds of the textrange object.

unfortunately, this only partially works. if you highlight the text,
and select within it, it'll still insert something at the top of the
page. if you do it again, however, it doesn't. also, if you refresh,
it doesn't insert it at the top of the page.

anyway, any help would be appreciated. here's the updated page:

http://www.frostjedi.com/terra/scripts/terra4.php
Jul 23 '05 #6

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

Similar topics

4
by: Csaba Gabor | last post by:
What I'd like to do is to be able to set the font of a textarea element to the same font that another element is using (say, for example, an <INPUT type=text ...> element, but if that's a no go,...
5
by: Jesper Rønn-Jensen | last post by:
I have a textarea that must be limited to 70 characters. No big deal -- at least so I thought. * Textarea must not exceed 70 characters * Exceeding content must be cut off * Must work on input by...
9
by: Paul Gorodyansky | last post by:
Hi, FAQ tells how to insert (or replace0 a text at a caret position in Mozilla (and same works for Opera 8+), for example, at http://www.faqts.com/knowledge_base/view.phtml/aid/1661 it talks...
3
by: arashamiri | last post by:
Hi, I wrote an auto resizing textarea: function myMax(anumber, another) { if (anumber > another) { return anumber; } return another; }
5
by: bwucke | last post by:
Is there any way to scroll textarea (to the bottom row) from Javascript in Opera? The textarea.scrollTop=textarea.scrollHeight+textarea.scrollTop; approach doesn't work, and there's so many...
5
by: Robine | last post by:
Hello all, looking for some help here! I've got a page on a website I'm developing that contains a textarea. The textarea will allow users of the site to enter a description of an item. When...
4
by: Keith Bentrup | last post by:
Hi all, I wrote a simple search function to find text in a textarea where not all the text is visible (ie. the text box displays 10 lines but there may be more than 1000 lines to search). I can...
16
by: Jen | last post by:
Hi. I have this problem that I think should be easy but have been struggling with this for days. I have a list based on a recordset from a database. This list consists of records meeting a certain...
5
by: a113n | last post by:
I have the following XSL code to handle textareas: <!-- Match TEXTAREA --> <xsl:template name="TEXTAREA" match="TEXTAREA"> <TEXTAREA ROWS="{@ROWS}" COLS="{@COLS}" NAME="{@NAME}"> <xsl:if...
3
by: saytri | last post by:
I am displaying the contents of a textfile in a textArea. I want that when i edit this text in the textArea it is automatically saved in the textfile. I have wriitten this code, but the problem is...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.