473,320 Members | 1,766 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,320 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 2609
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.