473,671 Members | 2,363 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Resizing of the TextArea on border or scrollbar

Hi,

I have created a html page from Java and I have added a .js file which
can resize a TextArea inside the html on mousedown event.

<script src="C:\temp\re size.js"</script>
<table<tr><td onmousedown="ja vascript:resize ('trinput',even t)">
<TEXTAREA NAME="input" id="trinput" COLS=40 ROWS=60>
my textarea here
</TEXTAREA>
</td>
</tr>
</table>

But now when I click on amny of the area of tes TextArea the textarea
starts resizing.

Can I do something like only when the mouse is down over the borders
of the <tdor scrollbars of the textareas only then resize script
should get called ?

Please help !

Cheers
Nick
Jun 27 '08 #1
1 2779
Nick wrote:
I have created a html page from Java and I have added a .js file which
can resize a TextArea inside the html on mousedown event.

<script src="C:\temp\re size.js"</script>
This is not supposed to work. The `src' attribute of the `script' element
is of type URI (and the `type' attribute is required):

<script type="text/javascript" src="file:///C:/temp/resize.js"></script>
<table<tr><td onmousedown="ja vascript:resize ('trinput',even t)">
`javascript:' is redundant here, and error-prone if used.
<TEXTAREA NAME="input" id="trinput" COLS=40 ROWS=60>
All attribute values should be properly delimited.
my textarea here
</TEXTAREA>
</td>
</tr>
</table>

But now when I click on amny of the area of tes TextArea the textarea
starts resizing.
i cna aslo tpye 020 charatcres pre mintue.
Can I do something like only when the mouse is down over the borders
of the <tdor scrollbars of the textareas only then resize script
should get called ?
Yes. Relevant properties: Event::clientX, Event::clientY,
HTMLElement::of fsetWidth, HTMLElement::cl ientWidth.

But if you simply prevented the event from bubbling, you would not have to
care about those details. Quick hack:

<script type="text/javascript">
function isMethod(o, p)
{
return o && /\s*(function|ob ject|unknown)\s */i.test(typeof o[p])
&& o[p];
}

function handleMouseDown (e)
{
if (isMethod(e, "stopPropagatio n"))
{
e.stopPropagati on();
}

if (typeof e.cancelBubble != "undefined" )
{
e.cancelBubble = true;
}
}
</script>

<textarea ...
onmousedown="if (typeof event != 'undefined') handleMouseDown (event);">
...
</textarea>
PointedEars
--
var bugRiddenCrashP ronePieceOfJunk = (
navigator.userA gent.indexOf('M SIE 5') != -1
&& navigator.userA gent.indexOf('M ac') != -1
) // Plone, register_functi on.js:16
Jun 27 '08 #2

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

Similar topics

2
4114
by: Mike Labman | last post by:
This is more of an HTML/CSS question, but I figure someone in here might know. I'm using in the stylesheet: BORDER-RIGHT: none; BORDER-TOP: none; BORDER-LEFT: none; BORDER-BOTTOM: none; OVERFLOW: hidden;
2
9468
by: Mike | last post by:
I need a little HTML/CSS help for cross-browser/cross-platform issues. I'm using a few stylesheet properties to hide the borders and scrollbar on a TEXTAREA object as follows: BORDER-RIGHT: none; BORDER-TOP: none; BORDER-LEFT: none; BORDER-BOTTOM: none; OVERFLOW: hidden;
19
4607
by: Eva | last post by:
Hi, I'm really really really new to javascripts and so i couldn't really comprehend thoroughly on the the previous posts regarding this issue. Anyways, I'm setting up a picture album site. When i click on a thumbnail or a picture, a larger picture pops up in a javascript window. But it has a space on the top and on the left of my larger pic in the pop-up window. How do i get rid of that? Also, i want the window to fit my my pic so...
2
104828
by: musicmouse | last post by:
Happy new year to you all, I have a problem with the css settings for the horizontal scrollbar of a textarea. When I look at my textarea's in Internet Explorer (I use 5.5) I see only a vertical scrollbar when the area contains a too long text. IE wil just break off the text at the limit if a single word is too long and put the next character on the next line. For me this is the desired bahaviour (those horizontal scrollbars take too...
2
11475
by: Mike Brophy | last post by:
Here's my problem: I need to present text in a scrolling textarea such that a checkbox is not enabled until the user has scrolled to the very last line of the text using the vertical scrollbar. Been searching for some functions to get scrollbar position for a textarea object but coming up empty. A nudge in the right direction would be appreciated. Thanks.
0
1610
by: =?Utf-8?B?cGF0cmlja2RyZA==?= | last post by:
Hi everyone! I have these three questions and though to post them in a single thread: 1) I have created a textarea: <textarea id="txtCards" cols="50" rows="15" runat="server" wrap="virtual" /> which is used for user editing (typing in some info).
9
5299
by: dli07 | last post by:
Hello, I'm trying to convert a piece of code that creates a dynamic vertical resizing bar in a table from internet explorer to firefox. It's based on a post from http://blogs.crankygoblin.com/blogs/geoff.appleby/pages/50712.aspx. I've also read the post on this topic by bggraphics, but he doesn't arrive at a final result. The main problem I am having is that the layerX and layerY event properties don't work. They're supposed to return the...
8
14012
by: honey99 | last post by:
Hi! i have a problem with textarea scrollbar in firefox.In FF it is taking horizantal scrollbar by default??but in IE vertical scrollbar is displaying correctly..I want vertical scrollbar in FF and how to avoid horizantal scrollbar in FF??check my code plz.... <TEXTAREA Name="text" rows=4 Cols="70"rows=4 Cols="70" onfocus="focuscolor(this)" onblur='javascript:blurcolor(this);' class="input" wrap="VIRTUAL"> regards
1
1601
by: Nick | last post by:
Hi, I have created a html page from Java and I have added a .js file which can resize a TextArea inside the html on mousedown event. <script src="C:\temp\resize.js"</script> <table<tr><td onmousedown="javascript:resize('trinput',event)"> <TEXTAREA NAME="input" id="trinput" COLS=40 ROWS=60> my textarea here </TEXTAREA>
0
8471
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8388
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8907
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8817
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8593
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6218
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4215
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4396
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1799
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.