473,383 Members | 1,846 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,383 software developers and data experts.

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\resize.js"</script>
<table<tr><td onmousedown="javascript:resize('trinput',event)">
<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 2757
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\resize.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="javascript:resize('trinput',event)">
`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::offsetWidth, HTMLElement::clientWidth.

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|object|unknown)\s*/i.test(typeof o[p])
&& o[p];
}

function handleMouseDown(e)
{
if (isMethod(e, "stopPropagation"))
{
e.stopPropagation();
}

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

<textarea ...
onmousedown="if (typeof event != 'undefined') handleMouseDown(event);">
...
</textarea>
PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16
Jun 27 '08 #2

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

Similar topics

2
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;...
2
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:...
19
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....
2
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...
2
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. ...
0
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"...
9
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...
8
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...
1
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...
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
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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.